var ECharts;
$(document).ready(function () {
    require.config({
        baseUrl: ctx + '/resource/plugins/echarts4',
        paths: {
            echarts: 'echarts',
            roma: 'theme/roma',
        }
    });
    require(
        [
            'echarts',
            'roma'
        ],
        function (ec) {
            ECharts = ec;
            DataBaseInformationViewController();//数据库基本信息
            database_tableSpace = ECharts.init(document.getElementById('database_tableSpace'), 'roma');//表空间使用率
            queryDataBaseBkjSyl();
            database_zdlj_zyl = ECharts.init(document.getElementById('database_zdlj_zyl'), 'roma');//PPPSGA使用率
            queryDataBaseZdLj();
            database_zdlj_slgl = ECharts.init(document.getElementById('database_zdlj_slgl'), 'roma');//PPPSGA使用率
            queryDataBaseZdLjDzt();
            database_gxnc_bfb = ECharts.init(document.getElementById('database_gxnc_bfb'), 'roma');//数据缓存区命中率
            queryDataBaseGxncZxt();
            database_gxnc_slgl = ECharts.init(document.getElementById('database_gxnc_slgl'), 'roma');//数据缓存区命中率
            queryDataBaseGxncDzt();
            database_read = ECharts.init(document.getElementById('database_read'), 'roma');//共享池缓存命中率
            queryDataBaseReadZxt();
            database_read_gl = ECharts.init(document.getElementById('database_read_gl'), 'roma');//共享池缓存命中率
            queryDataBaseReadDzt();
            database_sjzdhc_mzl = ECharts.init(document.getElementById('database_sjzdhc_mzl'), 'roma');//数据字典缓存命中率
            queryDataBase_sjzdhc_mzl();
            database_sjzdhc_mzl_qjfb = ECharts.init(document.getElementById('database_sjzdhc_mzl_qjfb'), 'roma');//数据字典缓存命中率
            queryDataBase_sjzdhc_mzl_qjfb();
            database_hgd_mzl = ECharts.init(document.getElementById('database_hgd_mzl'), 'roma');//回滚段命中率
            queryDataBase_hgd_mzl();
            database_hgd_mzl_qjfb = ECharts.init(document.getElementById('database_hgd_mzl_qjfb'), 'roma');//回滚段命中率
            queryDataBase_hgd_mzl_qjfb();
            database_nczpx_mzl = ECharts.init(document.getElementById('database_nczpx_mzl'), 'roma');//内存中排序占的比率
            queryDataBase_nczpx_mzl();
            database_nczpx_mzl_qjfb = ECharts.init(document.getElementById('database_nczpx_mzl_qjfb'), 'roma');//内存中排序占的比率
            queryDataBase_nczpx_mzl_qjfb();
            database_hjss = ECharts.init(document.getElementById('database_hjss'), 'roma');//行级锁数
            queryKpi_hjss();
            database_bjss = ECharts.init(document.getElementById('database_bjss'), 'roma');//表级锁数
            queryKpi_bjss();
            database_sss = ECharts.init(document.getElementById('database_sss'), 'roma');//死锁数
            queryKpi_sss();
            database_sdds = ECharts.init(document.getElementById('database_sdds'), 'roma');//锁等待数
            queryKpi_sdds();
        }
    );
    // queryGdm();//回滚段指标信息
    /*queryUndotable();//UNDO表空间*/
});


var infoList = [];//数据库基本信息
infoList.push("KPI-oracle-all-1");
infoList.push("KPI-oracle-all-2");
infoList.push("KPI-oracle-all-6");
infoList.push("KPI-oracle-all-13");
infoList.push("KPI-oracle-all-30");
infoList.push("KPI-oracle-all-31");
//===================================
// infoList.push("PM-00-03-009-20");
// infoList.push("PM-00-03-009-10");
// infoList.push("PM-00-03-008-02");
// infoList.push("PM-00-03-009-05");
// infoList.push("PM-00-04-012-01");
// infoList.push("PM-00-03-009-03");
// infoList.push("PM-00-03-009-06");
// infoList.push("PM-20-20-001-53");
// infoList.push("PM-00-03-009-22");
// infoList.push("PM-00-03-008-01");
// infoList.push("PM-00-03-009-15");
// infoList.push("PM-00-03-009-08");
// infoList.push("CM-00-03-002-01");
// infoList.push("PM-00-03-009-12");
//===========================================
var gdList = [];//回滚段指标信息
gdList.push("PM-00-03-007-01");
gdList.push("PM-00-03-007-02");
//===========================================
var undoList = [];//UNDO表空间
undoList.push("FM-00-03-001-02");
undoList.push("PM-00-03-009-11");
//==============================================
//数据库基本信息
function DataBaseInformationViewController() {
    var str = infoList.toString();
    $.ajax({
        url: ctx + "/load/queryInfo",
        type: "post",
        data: "EXT_UNIT_ID=" + EXT_UNIT_ID + "&RESU=" + str + "&CLASS_NAME=" + CLASS_NAME,
        success: function (data) {
            var map = JSON.parse(data);
            var list1 = map["KPI-oracle-all-1"];
            var list2 = map["KPI-oracle-all-2"];
            var list3 = map["KPI-oracle-all-6"];
            var list4 = map["KPI-oracle-all-13"];
            var list5 = map["KPI-oracle-all-30"];
            var list6 = map["KPI-oracle-all-31"];
            var tablel = "<tr>" +
                "<th><span >" + "指标名" + "</span></th>" +
                "<th><span >" + "采集值" + "</span></th>" +
                "</tr>";
            if (list1.length == 0) {
                tablel += "<tr>" +
                    "<td><span >" + "管理IP" + "</span></td>" +
                    "<td><span >" + "暂无数据" + "</span></td>" +
                    "</tr>";
            } else {
                tablel += "<tr>" +
                    "<td><span >" + list1[0].KPI_NAME + "</span></td>" +
                    "<td><span >" + list1[0].KPI_VALUE + "</span></td>" +
                    "</tr>";
            }
            if (list2.length == 0) {
                tablel += "<tr>" +
                    "<td><span >" + "数据库名称" + "</span></td>" +
                    "<td><span >" + "暂无数据" + "</span></td>" +
                    "</tr>";
            } else {
                tablel += "<tr>" +
                    "<td><span >" + list2[0].KPI_NAME + "</span></td>" +
                    "<td><span >" + list2[0].KPI_VALUE + "</span></td>" +
                    "</tr>";
            }
            if (list3.length == 0) {
                tablel += "<tr>" +
                    "<td><span >" + "实例名" + "</span></td>" +
                    "<td><span >" + "暂无数据" + "</span></td>" +
                    "</tr>";
            } else {
                tablel += "<tr>" +
                    "<td><span >" + list3[0].KPI_NAME + "</span></td>" +
                    "<td><span >" + list3[0].KPI_VALUE + "</span></td>" +
                    "</tr>";
            }
            if (list4.length == 0) {
                tablel += "<tr>" +
                    "<td><span >" + "管理等级" + "</span></td>" +
                    "<td><span >" + "暂无数据" + "</span></td>" +
                    "</tr>";
            } else {
                tablel += "<tr>" +
                    "<td><span >" + list4[0].KPI_NAME + "</span></td>" +
                    "<td><span >" + list4[0].KPI_VALUE + "</span></td>" +
                    "</tr>";
            }
            if (list5.length == 0) {
                tablel += "<tr>" +
                    "<td><span >" + "表空间类型" + "</span></td>" +
                    "<td><span >" + "暂无数据" + "</span></td>" +
                    "</tr>";
            } else {
                tablel += "<tr>" +
                    "<td><span >" + list5[0].KPI_NAME + "</span></td>" +
                    "<td><span >" + list5[0].KPI_VALUE + "</span></td>" +
                    "</tr>";
            }
            if (list6.length == 0) {
                tablel += "<tr>" +
                    "<td><span >" + "表空间名称(key)" + "</span></td>" +
                    "<td><span >" + "暂无数据" + "</span></td>" +
                    "</tr>";
            } else {
                tablel += "<tr>" +
                    "<td><span >" + list6[0].KPI_NAME + "</span></td>" +
                    "<td><span >" + list6[0].KPI_VALUE + "</span></td>" +
                    "</tr>";
            }
            $("#database_info").append(tablel);
        }, error: function (textStatus) {
            console.log("error:" + textStatus.status);
        }
    });
}

//数据库状态
//FM-00-03-001-01
function queryDataBaseState() {
    $.ajax({
        url: ctx + "/load/queryNum",
        type: "post",
        data: "EXT_UNIT_ID=" + EXT_UNIT_ID + "&KPI_CODE=" + "FM-00-03-001-01" + "&DATE_TYPE=" + DATE_TYPE + "&CLASS_NAME=" + CLASS_NAME,
        success: function (data) {
            var cpuState = JSON.parse(data);
            var mydata;
            for (var i = 0; i < cpuState.length; i++) {
                var a = cpuState[i].SUCCESS_VALUE;
                var b = cpuState[i].COUNT_VALUE;
            }
            option = {
                tooltip: {
                    formatter: "{a} <br/>{b} : {c}%"
                },
                toolbox: {
                    show: true,
                    feature: {
                        mark: {show: true},
                        // restore: {show: true},
                        // saveAsImage: {show: true}
                    }
                },
                series: [
                    {
                        name: '',
                        type: 'gauge',
                        splitNumber: 10,       // 分割段数，默认为5
                        axisLine: {            // 坐标轴线
                            lineStyle: {       // 属性lineStyle控制线条样式
                                color: [[0.2, '#ff4500'], [0.8, '#48b'], [1, '#228b22']],
                                width: 8
                            }
                        },
                        axisTick: {            // 坐标轴小标记
                            splitNumber: 10,   // 每份split细分多少段
                            length: 12,        // 属性length控制线长
                            lineStyle: {       // 属性lineStyle控制线条样式
                                color: 'auto'
                            }
                        },
                        axisLabel: {           // 坐标轴文本标签，详见axis.axisLabel
                            textStyle: {       // 其余属性默认使用全局文本样式，详见TEXTSTYLE
                                color: 'auto'
                            }
                        },
                        splitLine: {           // 分隔线
                            show: true,        // 默认显示，属性show控制显示与否
                            length: 30,         // 属性length控制线长
                            lineStyle: {       // 属性lineStyle（详见lineStyle）控制线条样式
                                color: 'auto'
                            }
                        },
                        pointer: {
                            width: 5
                        },
                        title: {
                            show: true,
                            offsetCenter: [0, '-40%'],       // x, y，单位px
                            textStyle: {       // 其余属性默认使用全局文本样式，详见TEXTSTYLE
                                fontWeight: 'bolder'
                            }
                        },
                        detail: {
                            formatter: '{value}%',
                            textStyle: {       // 其余属性默认使用全局文本样式，详见TEXTSTYLE
                                color: 'auto',
                                fontWeight: 'bolder'
                            }
                        },
                        data: []
                    }
                ]
            };//仪表盘结束
            var cpuName = "";
            var succ = [];
            var sun = [];
            var p_value = 0;
            var q_value = 0;
            var succs = 0;
            var sums = 0;
            if (DATE_TYPE == "showYear") {
                for (var j = 0; j < cpuState.length; j++) {
                    p_value = parseInt(cpuState[j].SUCCESS_VALUE);
                    succ.push(p_value);
                    q_value = parseInt(cpuState[j].COUNT_VALUE);
                    sun.push(q_value);
                    cpuName = cpuState[j].KPI_NAME;
                }
                for (var k = 0; k < succ.length; k++) {
                    succs += succ[k];
                    sums += sun[k];
                }
                /*alert(succs);alert(sums);*/
                mydata = [{value: parseInt(succs / sums * 100), name: cpuName}];
            } else {
                for (var i = 0; i < cpuState.length; i++) {
                    mydata = [{
                        value: parseInt(cpuState[i].SUCCESS_VALUE / cpuState[i].COUNT_VALUE * 100),
                        name: cpuState[i].KPI_NAME
                    }];
                }
            }

            if (a == undefined || b == undefined) {
                var table = "<h3 style='margin-top: 180px;padding-left: 140px;'>" + "暂无数据" + "</h3>";
                $("#database_state").html(table);
            } else {
                option.series[0].data = mydata;
                database_state.setOption(option);
            }
        }, error: function (textStatus) {
            console.log("error:" + textStatus.status);
        }
    });

}

//JDBC可链接性
//FM-00-03-001-04
function queryDataBaseJdbc() {
    $.ajax({
        url: ctx + "/load/queryNum",
        type: "post",
        data: "EXT_UNIT_ID=" + EXT_UNIT_ID + "&KPI_CODE=" + "FM-00-03-001-04" + "&DATE_TYPE=" + DATE_TYPE + "&CLASS_NAME=" + CLASS_NAME,
        success: function (data) {
            var cpuState = JSON.parse(data);
            var mydata;
            for (var i = 0; i < cpuState.length; i++) {
                var a = cpuState[i].SUCCESS_VALUE;
                var b = cpuState[i].COUNT_VALUE;
            }
            option = {
                tooltip: {
                    formatter: "{a} <br/>{b} : {c}%"
                },
                toolbox: {
                    show: true,
                    feature: {
                        mark: {show: true},
                        // restore: {show: true},
                        // saveAsImage: {show: true}
                    }
                },
                series: [
                    {
                        name: '',
                        type: 'gauge',
                        splitNumber: 10,       // 分割段数，默认为5
                        axisLine: {            // 坐标轴线
                            lineStyle: {       // 属性lineStyle控制线条样式
                                color: [[0.2, '#ff4500'], [0.8, '#48b'], [1, '#228b22']],
                                width: 8
                            }
                        },
                        axisTick: {            // 坐标轴小标记
                            splitNumber: 10,   // 每份split细分多少段
                            length: 12,        // 属性length控制线长
                            lineStyle: {       // 属性lineStyle控制线条样式
                                color: 'auto'
                            }
                        },
                        axisLabel: {           // 坐标轴文本标签，详见axis.axisLabel
                            textStyle: {       // 其余属性默认使用全局文本样式，详见TEXTSTYLE
                                color: 'auto'
                            }
                        },
                        splitLine: {           // 分隔线
                            show: true,        // 默认显示，属性show控制显示与否
                            length: 30,         // 属性length控制线长
                            lineStyle: {       // 属性lineStyle（详见lineStyle）控制线条样式
                                color: 'auto'
                            }
                        },
                        pointer: {
                            width: 5
                        },
                        title: {
                            show: true,
                            offsetCenter: [0, '-40%'],       // x, y，单位px
                            textStyle: {       // 其余属性默认使用全局文本样式，详见TEXTSTYLE
                                fontWeight: 'bolder'
                            }
                        },
                        detail: {
                            formatter: '{value}%',
                            textStyle: {       // 其余属性默认使用全局文本样式，详见TEXTSTYLE
                                color: 'auto',
                                fontWeight: 'bolder'
                            }
                        },
                        data: []
                    }
                ]
            };//仪表盘结束
            var cpuName = "";
            var succ = [];
            var sun = [];
            var p_value = 0;
            var q_value = 0;
            var succs = 0;
            var sums = 0;
            if (DATE_TYPE == "showYear") {
                for (var j = 0; j < cpuState.length; j++) {
                    p_value = parseInt(cpuState[j].SUCCESS_VALUE);
                    succ.push(p_value);
                    q_value = parseInt(cpuState[j].COUNT_VALUE);
                    sun.push(q_value);
                    cpuName = cpuState[j].KPI_NAME;
                }
                for (var k = 0; k < succ.length; k++) {
                    succs += succ[k];
                    sums += sun[k];
                }
                /*alert(succs);alert(sums);*/
                mydata = [{value: parseInt(succs / sums * 100), name: cpuName}];
            } else {
                for (var i = 0; i < cpuState.length; i++) {
                    mydata = [{
                        value: parseInt(cpuState[i].SUCCESS_VALUE / cpuState[i].COUNT_VALUE * 100),
                        name: cpuState[i].KPI_NAME
                    }];
                }
            }

            if (a == undefined || b == undefined) {
                var table = "<h3 style='margin-top: 180px;padding-left: 140px;'>" + "暂无数据" + "</h3>";
                $("#database_jdbc").html(table);
            } else {
                option.series[0].data = mydata;
                database_jdbc.setOption(option);
            }
        }, error: function (textStatus) {
            console.log("error:" + textStatus.status);
        }
    });

}

//行级锁数
function queryKpi_hjss() {
    var timeHorizon = '';
    if (DATE_TYPE == 'showWeek') {
        timeHorizon = 'showOneWeek';
    } else if (DATE_TYPE == 'showMonth') {
        timeHorizon = 'showOneMonth';
    } else if (DATE_TYPE == 'showYear') {
        timeHorizon = 'showOneYear';
    } else {
        timeHorizon = 'showYesToday';
    }
    $.ajax({
        url: ctx + "/kpiContrast/queryKpiContrastInfo",
        type: "post",
        data: {extUnitId: EXT_UNIT_ID, kpiCode: 'KPI-oracle-all-44', timeHorizon: timeHorizon},
        success: function (data) {
            var list = JSON.parse(data);
            var ydata = [];
            var avgValue = [];
            var maxValue = [];
            var mixValue = [];
            var modelValue = [];
            if (list != null && list.length != 0) {
                for (var i = 0; i < list.length; i++) {
                    if (DATE_TYPE == "showWeek") {
                        x_value = list[i].DATA_TIME.split("-");
                        ydata.push(x_value[2]);
                    } else if (DATE_TYPE == "showMonth") {
                        x_value = list[i].DATA_TIME.split("-");
                        ydata.push(x_value[2]);
                    } else if (DATE_TYPE == "showYear") {
                        x_value = list[i].DATA_TIME.split("-");
                        ydata.push(x_value[1]);
                    } else {
                        x_value = list[i].DATA_TIME.replace(' ', '-').split("-");
                        ydata.push(x_value[3]);
                    }
                    avgValue.push(list[i].AVG_VALUE);
                    maxValue.push(list[i].MAX_VALUE);
                    mixValue.push(list[i].MIN_VALUE);
                    modelValue.push(list[i].MODEL_VALUE);
                }
                option = {
                    tooltip: {
                        trigger: 'axis'
                    },
                    legend: {
                        data: ['平均值', '最大值', '最小值', '众数']
                    },
                    grid: {
                        left: '3%',
                        right: '4%',
                        bottom: '3%',
                        containLabel: true
                    },
                    xAxis: {
                        type: 'category',
                        boundaryGap: false,
                        data: ydata,
                        axisLabel: {
                            interval: 0,
                            rotate: 0
                        }
                    },
                    yAxis: {
                        type: 'value'
                    },
                    series: [
                        {
                            name: '平均值',
                            type: 'line',
                            stack: '总量',
                            data: avgValue
                        },
                        {
                            name: '最大值',
                            type: 'line',
                            stack: '总量',
                            data: maxValue
                        },
                        {
                            name: '最小值',
                            type: 'line',
                            stack: '总量',
                            data: mixValue
                        },
                        {
                            name: '众数',
                            type: 'line',
                            stack: '总量',
                            data: modelValue
                        }
                    ]
                };
                database_hjss.setOption(option);
            } else {
                $('#database_hjss').before("抱歉，暂无数据展示。");
            }
        },
        error: function (textStatus) {
            console.log("error:" + textStatus.status);
        }
    });
}

//表级锁数
function queryKpi_bjss() {
    var timeHorizon = '';
    if (DATE_TYPE == 'showWeek') {
        timeHorizon = 'showOneWeek';
    } else if (DATE_TYPE == 'showMonth') {
        timeHorizon = 'showOneMonth';
    } else if (DATE_TYPE == 'showYear') {
        timeHorizon = 'showOneYear';
    } else {
        timeHorizon = 'showYesToday';
    }
    $.ajax({
        url: ctx + "/kpiContrast/queryKpiContrastInfo",
        type: "post",
        data: {extUnitId: EXT_UNIT_ID, kpiCode: 'KPI-oracle-all-45', timeHorizon: timeHorizon},
        success: function (data) {
            var list = JSON.parse(data);
            var ydata = [];
            var avgValue = [];
            var maxValue = [];
            var mixValue = [];
            var modelValue = [];
            if (list != null && list.length != 0) {
                for (var i = 0; i < list.length; i++) {
                    if (DATE_TYPE == "showWeek") {
                        x_value = list[i].DATA_TIME.split("-");
                        ydata.push(x_value[2]);
                    } else if (DATE_TYPE == "showMonth") {
                        x_value = list[i].DATA_TIME.split("-");
                        ydata.push(x_value[2]);
                    } else if (DATE_TYPE == "showYear") {
                        x_value = list[i].DATA_TIME.split("-");
                        ydata.push(x_value[1]);
                    } else {
                        x_value = list[i].DATA_TIME.replace(' ', '-').split("-");
                        ydata.push(x_value[3]);
                    }
                    avgValue.push(list[i].AVG_VALUE);
                    maxValue.push(list[i].MAX_VALUE);
                    mixValue.push(list[i].MIN_VALUE);
                    modelValue.push(list[i].MODEL_VALUE);
                }
                option = {
                    tooltip: {
                        trigger: 'axis'
                    },
                    legend: {
                        data: ['平均值', '最大值', '最小值', '众数']
                    },
                    grid: {
                        left: '3%',
                        right: '4%',
                        bottom: '3%',
                        containLabel: true
                    },
                    xAxis: {
                        type: 'category',
                        boundaryGap: false,
                        data: ydata,
                        axisLabel: {
                            interval: 0,
                            rotate: 0
                        }
                    },
                    yAxis: {
                        type: 'value'
                    },
                    series: [
                        {
                            name: '平均值',
                            type: 'line',
                            stack: '总量',
                            data: avgValue
                        },
                        {
                            name: '最大值',
                            type: 'line',
                            stack: '总量',
                            data: maxValue
                        },
                        {
                            name: '最小值',
                            type: 'line',
                            stack: '总量',
                            data: mixValue
                        },
                        {
                            name: '众数',
                            type: 'line',
                            stack: '总量',
                            data: modelValue
                        }
                    ]
                };
                database_bjss.setOption(option);
            } else {
                $('#database_bjss').before("抱歉，暂无数据展示。");
            }
        },
        error: function (textStatus) {
            console.log("error:" + textStatus.status);
        }
    });
}

//死锁数
function queryKpi_sss() {
    var timeHorizon = '';
    if (DATE_TYPE == 'showWeek') {
        timeHorizon = 'showOneWeek';
    } else if (DATE_TYPE == 'showMonth') {
        timeHorizon = 'showOneMonth';
    } else if (DATE_TYPE == 'showYear') {
        timeHorizon = 'showOneYear';
    } else {
        timeHorizon = 'showYesToday';
    }
    $.ajax({
        url: ctx + "/kpiContrast/queryKpiContrastInfo",
        type: "post",
        data: {extUnitId: EXT_UNIT_ID, kpiCode: 'KPI-oracle-all-46', timeHorizon: timeHorizon},
        success: function (data) {
            var list = JSON.parse(data);
            var ydata = [];
            var avgValue = [];
            var maxValue = [];
            var mixValue = [];
            var modelValue = [];
            if (list != null && list.length != 0) {
                for (var i = 0; i < list.length; i++) {
                    if (DATE_TYPE == "showWeek") {
                        x_value = list[i].DATA_TIME.split("-");
                        ydata.push(x_value[2]);
                    } else if (DATE_TYPE == "showMonth") {
                        x_value = list[i].DATA_TIME.split("-");
                        ydata.push(x_value[2]);
                    } else if (DATE_TYPE == "showYear") {
                        x_value = list[i].DATA_TIME.split("-");
                        ydata.push(x_value[1]);
                    } else {
                        x_value = list[i].DATA_TIME.replace(' ', '-').split("-");
                        ydata.push(x_value[3]);
                    }
                    avgValue.push(list[i].AVG_VALUE);
                    maxValue.push(list[i].MAX_VALUE);
                    mixValue.push(list[i].MIN_VALUE);
                    modelValue.push(list[i].MODEL_VALUE);
                }
                option = {
                    tooltip: {
                        trigger: 'axis'
                    },
                    legend: {
                        data: ['平均值', '最大值', '最小值', '众数']
                    },
                    grid: {
                        left: '3%',
                        right: '4%',
                        bottom: '3%',
                        containLabel: true
                    },
                    xAxis: {
                        type: 'category',
                        boundaryGap: false,
                        data: ydata,
                        axisLabel: {
                            interval: 0,
                            rotate: 0
                        }
                    },
                    yAxis: {
                        type: 'value'
                    },
                    series: [
                        {
                            name: '平均值',
                            type: 'line',
                            stack: '总量',
                            data: avgValue
                        },
                        {
                            name: '最大值',
                            type: 'line',
                            stack: '总量',
                            data: maxValue
                        },
                        {
                            name: '最小值',
                            type: 'line',
                            stack: '总量',
                            data: mixValue
                        },
                        {
                            name: '众数',
                            type: 'line',
                            stack: '总量',
                            data: modelValue
                        }
                    ]
                };
                database_sss.setOption(option);
            } else {
                $('#database_sss').before("抱歉，暂无数据展示。");
            }
        },
        error: function (textStatus) {
            console.log("error:" + textStatus.status);
        }
    });
}

//锁等待数
function queryKpi_sdds() {
    var timeHorizon = '';
    if (DATE_TYPE == 'showWeek') {
        timeHorizon = 'showOneWeek';
    } else if (DATE_TYPE == 'showMonth') {
        timeHorizon = 'showOneMonth';
    } else if (DATE_TYPE == 'showYear') {
        timeHorizon = 'showOneYear';
    } else {
        timeHorizon = 'showYesToday';
    }
    $.ajax({
        url: ctx + "/kpiContrast/queryKpiContrastInfo",
        type: "post",
        data: {extUnitId: EXT_UNIT_ID, kpiCode: 'KPI-oracle-all-47', timeHorizon: timeHorizon},
        success: function (data) {
            var list = JSON.parse(data);
            var ydata = [];
            var avgValue = [];
            var maxValue = [];
            var mixValue = [];
            var modelValue = [];
            if (list != null && list.length != 0) {
                for (var i = 0; i < list.length; i++) {
                    if (DATE_TYPE == "showWeek") {
                        x_value = list[i].DATA_TIME.split("-");
                        ydata.push(x_value[2]);
                    } else if (DATE_TYPE == "showMonth") {
                        x_value = list[i].DATA_TIME.split("-");
                        ydata.push(x_value[2]);
                    } else if (DATE_TYPE == "showYear") {
                        x_value = list[i].DATA_TIME.split("-");
                        ydata.push(x_value[1]);
                    } else {
                        x_value = list[i].DATA_TIME.replace(' ', '-').split("-");
                        ydata.push(x_value[3]);
                    }
                    avgValue.push(list[i].AVG_VALUE);
                    maxValue.push(list[i].MAX_VALUE);
                    mixValue.push(list[i].MIN_VALUE);
                    modelValue.push(list[i].MODEL_VALUE);
                }
                option = {
                    tooltip: {
                        trigger: 'axis'
                    },
                    legend: {
                        data: ['平均值', '最大值', '最小值', '众数']
                    },
                    grid: {
                        left: '3%',
                        right: '4%',
                        bottom: '3%',
                        containLabel: true
                    },
                    xAxis: {
                        type: 'category',
                        boundaryGap: false,
                        data: ydata,
                        axisLabel: {
                            interval: 0,
                            rotate: 0
                        }
                    },
                    yAxis: {
                        type: 'value'
                    },
                    series: [
                        {
                            name: '平均值',
                            type: 'line',
                            stack: '总量',
                            data: avgValue
                        },
                        {
                            name: '最大值',
                            type: 'line',
                            stack: '总量',
                            data: maxValue
                        },
                        {
                            name: '最小值',
                            type: 'line',
                            stack: '总量',
                            data: mixValue
                        },
                        {
                            name: '众数',
                            type: 'line',
                            stack: '总量',
                            data: modelValue
                        }
                    ]
                };
                database_sdds.setOption(option);
            } else {
                $('#database_sdds').before("抱歉，暂无数据展示。");
            }
        },
        error: function (textStatus) {
            console.log("error:" + textStatus.status);
        }
    });
}


//PPPSGA使用率
//PM-00-03-009-09
function queryDataBaseZdLj() {

    $.ajax({
        url: ctx + "/load/queryLoad",
        type: "post",
        data: "EXT_UNIT_ID=" + EXT_UNIT_ID + "&KPI_CODE=" + "KPI-oracle-all-29" + "&DATE_TYPE=" + DATE_TYPE + "&CLASS_NAME=" + CLASS_NAME,
        success: function (data) {
            var map = JSON.parse(data);
            var list = map.list;
            var listTb = map.listTb;
            var listHb = map.listHb;
            var xdata = [];
            var ydata1 = [];
            var ydata2 = [];
            var ydata3 = [];
            var x_value = [];
            for (var i = 0; i < list.length; i++) {
                var a = list[i].AVG_VALUE;
                var b = listTb[i].AVG_VALUE;
                // var c = listHb[i].AVG_VALUE;
            }
            if (a == undefined || b == undefined) {
                var table = "<h3 style='margin-top: 200px;padding-left: 340px;'>" + "暂无数据" + "</h3>";
                $("#database_zdlj_zyl").html(table);
            } else {
                if (DATE_TYPE == "showWeek") {
                    for (var i = 0; i < list.length; i++) {
                        x_value = list[i].DATA_TIME.split("-");
                        xdata.push(x_value[2]);
                        ydata1.push(list[i].AVG_VALUE);
                        ydata2.push(listTb[i].AVG_VALUE);
                        ydata3.push(listHb[i].AVG_VALUE);
                    }
                } else if (DATE_TYPE == "showMonth") {
                    for (var i = 0; i < list.length; i++) {
                        x_value = list[i].DATA_TIME.split("-");
                        xdata.push(x_value[2]);
                        ydata1.push(list[i].AVG_VALUE);
                        ydata2.push(listTb[i].AVG_VALUE);
                        ydata3.push(listHb[i].AVG_VALUE);
                    }
                    /*  option.xAxis.axisLabel.formatter='{value} d';*/
                } else if (DATE_TYPE == "showYear") {
                    for (var i = 0; i < list.length; i++) {
                        // xdata.push(list[i].DATA_TIME);
                        x_value = list[i].DATA_TIME.split("-");
                        xdata.push(x_value[1]);
                        ydata1.push(list[i].AVG_VALUE);
                        ydata2.push(listTb[i].AVG_VALUE);
                        /* ydata3.push(listHb[i].AVG_VALUE);*/
                    }
                } else {
                    for (var i = 0; i < list.length; i++) {
                        x_value = list[i].DATA_TIME.replace(' ', '-').split("-");
                        xdata.push(x_value[3]);
                        ydata1.push(list[i].AVG_VALUE);
                        ydata2.push(listTb[i].AVG_VALUE);
                        ydata3.push(listHb[i].AVG_VALUE);
                    }
                }
                option = {
                    tooltip: {
                        trigger: 'axis',
                    },
                    legend: {
                        data: ['昨日', '同比', '环比'],
                        textStyle: {
                            color: '#AAAAAA'
                        }
                    },
                    grid: {
                        left: '3%',
                        right: '4%',
                        bottom: '3%',
                        containLabel: true
                    },
                    xAxis: [{
                        type: 'category',
                        boundaryGap: false,
                        axisLabel: {
                            /*formatter:'{value} h',*/
                            textStyle: {
                                color: '#AAAAAA'
                            }
                        },
                        data: xdata
                    }],
                    yAxis: [{
                        type: 'value',
                        max: 100,//Y轴最大值 不写的话自动调节
                        axisLabel: {
                            formatter: '{value} %',
                            textStyle: {
                                color: '#AAAAAA'
                            }
                        }
                    }],
                    series: [
                        {
                            name: '昨日',
                            type: 'line',
                            color: '#EFB700',
                            data: ydata1
                        },
                        {
                            name: '同比',
                            type: 'line',
                            color: '#FF0A0E',
                            data: ydata2
                        },
                        {
                            name: '环比',
                            type: 'line',
                            color: '#0AFFBD',
                            data: ydata3
                        }
                    ]
                };
                database_zdlj_zyl.setOption(option);
            }
        }, error: function (textStatus) {
            console.log("error:" + textStatus.status);
        }
    });
}


//PPPSGA使用率区间分布
//PM-00-03-009-09
function queryDataBaseZdLjDzt() {

    $.ajax({
        url: ctx + "/load/queryNum",
        type: "post",
        data: "DATE_TYPE=" + DATE_TYPE + "&EXT_UNIT_ID=" + EXT_UNIT_ID + "&KPI_CODE=" + "KPI-oracle-all-29" + "&CLASS_NAME=" + CLASS_NAME,
        success: function (data) {
            var memoryNum = JSON.parse(data);
            var xdata = [];
            var num1 = '';
            var min_value = '';
            var max_value = '';
            var group = '';
            var p = [];
            var values = [];
            var result = [0, 0, 0, 0, 0];
            var temp = '';
            var temp1 = '';
            var hkh = '';
            var myMap = new Map();
            var sum = 0;
            for (var i = 0; i < memoryNum.length; i++) {
                var a = memoryNum[i].GROUP_VALUE;
            }
            if (a == undefined) {
                var table = "<h3 style='margin-top: 200px;padding-left: 340px;'>" + "暂无数据" + "</h3>";
                $("#database_zdlj_slgl").html(table);
            } else {
                if (DATE_TYPE != "showYear") {//，分割分完的截取每个元素的倒数第一个或者第二个双引号的值{"0.0~20.0":"289"，"20.0~40.0":"290，"40.0~60.0":"291"}
                    for (var i = 0; i < memoryNum.length; i++) {
                        hkh = memoryNum[i].GROUP_VALUE.substring(1, memoryNum[i].GROUP_VALUE.lastIndexOf('}'));
                        num1 = hkh.split(',');
                        min_value = memoryNum[i].Y_MIN_VALUE;
                        max_value = memoryNum[i].Y_MAX_VALUE;
                        group = memoryNum[i].VALUE_GROUP;
                        for (j = 0; j < num1.length; j++) {
                            temp = num1[j].substring(num1[j].lastIndexOf(':"') + 2, num1[j].lastIndexOf('"'));
                            temp1 = num1[j].substring(1, num1[j].lastIndexOf('":'));
                            myMap.set(temp1, temp);
                        }
                        if (myMap.get("0.0~20.0") != null) {
                            xdata.push(myMap.get("0.0~20.0"));
                        } else {
                            xdata.push(0);
                        }
                        if (myMap.get("20.0~40.0") != null) {
                            xdata.push(myMap.get("20.0~40.0"));
                        } else {
                            xdata.push(0);
                        }
                        if (myMap.get("40.0~60.0") != null) {
                            xdata.push(myMap.get("40.0~60.0"));
                        } else {
                            xdata.push(0);
                        }
                        if (myMap.get("60.0~80.0") != null) {
                            xdata.push(myMap.get("60.0~80.0"));
                        } else {
                            xdata.push(0);
                        }
                        if (myMap.get("80.0~100.0") != null) {
                            xdata.push(myMap.get("80.0~100.0"));
                        } else {
                            xdata.push(0);
                        }
                    }
                } else {
                    for (var i = 0; i < memoryNum.length; i++) {
                        hkh = memoryNum[i].GROUP_VALUE.substring(1, memoryNum[i].GROUP_VALUE.lastIndexOf('}'));
                        num1 = hkh.split(',');
                        min_value = memoryNum[i].Y_MIN_VALUE;
                        max_value = memoryNum[i].Y_MAX_VALUE;
                        group = memoryNum[i].VALUE_GROUP;
                        for (var j = 0; j < num1.length; j++) {
                            temp = num1[j].substring(num1[j].lastIndexOf(':"') + 2, num1[j].lastIndexOf('"'));
                            temp1 = num1[j].substring(1, num1[j].lastIndexOf('":'));
                            if (temp) {
                                sum = parseInt(sum) + parseInt(temp);
                            }
                            myMap.set(temp1, sum);
                        }
                    }
                    if (myMap.get("0.0~20.0") != null) {
                        xdata.push(myMap.get("0.0~20.0"));
                    } else {
                        xdata.push(0);
                    }
                    if (myMap.get("20.0~40.0") != null) {
                        xdata.push(myMap.get("20.0~40.0"));
                    } else {
                        xdata.push(0);
                    }
                    if (myMap.get("40.0~60.0") != null) {
                        xdata.push(myMap.get("40.0~60.0"));
                    } else {
                        xdata.push(0);
                    }
                    if (myMap.get("60.0~80.0") != null) {
                        xdata.push(myMap.get("60.0~80.0"));
                    } else {
                        xdata.push(0);
                    }
                    if (myMap.get("80.0~100.0") != null) {
                        xdata.push(myMap.get("80.0~100.0"));
                    } else {
                        xdata.push(0);
                    }
                }
                option = {
                    color: ['#23CBFE'],
                    title: {
                        text: '',
                        subtext: ''
                    },
                    tooltip: {
                        trigger: 'axis',
                        axisPointer: {
                            type: 'shadow'
                        }
                    },
                    legend: {
                        data: ['PPPSGA使用率区间分布'],
                        textStyle: {
                            color: '#AAAAAA'
                        }
                    },
                    grid: {
                        left: '3%',
                        right: '4%',
                        bottom: '3%',
                        containLabel: true
                    },
                    xAxis: {
                        type: 'value',
                        boundaryGap: [0, 0.01],
                        splitLine: {
                            show: false
                        },
                        axisLabel: {
                            textStyle: {
                                color: '#AAAAAA'
                            }
                        }
                    },
                    yAxis: {
                        type: 'category',
                        splitLine: {
                            show: true
                        },
                        axisLabel: {
                            /* formatter:'{value} %',*/
                            textStyle: {
                                color: '#AAAAAA'
                            }
                        },
                        data: [
                            (100 - 0) / 5,
                            (100 - 0) / 5 * 2,
                            (100 - 0) / 5 * 3,
                            (100 - 0) / 5 * 4,
                            (100 - 0) / 5 * 5,
                        ]
                    },
                    series: [
                        {
                            name: 'PPPSGA使用率区间分布',
                            type: 'bar',
                            barWidth: 30,
                            data: xdata
                        }
                    ]

                };
                database_zdlj_slgl.setOption(option);
            }
        }, error: function (textStatus) {
            console.log("error:" + textStatus.status);
        }
    });
}


//数据缓存区命中率
//PM-00-03-009-07
function queryDataBaseGxncZxt() {

    $.ajax({
        url: ctx + "/load/queryLoad",
        type: "post",
        data: "EXT_UNIT_ID=" + EXT_UNIT_ID + "&KPI_CODE=" + "KPI-oracle-all-38" + "&DATE_TYPE=" + DATE_TYPE + "&CLASS_NAME=" + CLASS_NAME,
        success: function (data) {
            var map = JSON.parse(data);
            var list = map.list;
            var listTb = map.listTb;
            var listHb = map.listHb;
            var xdata = [];
            var ydata1 = [];
            var ydata2 = [];
            var ydata3 = [];
            var x_value = [];
            for (var i = 0; i < list.length; i++) {
                var a = list[i].AVG_VALUE;
                var b = listTb[i].AVG_VALUE;
                // var c = listHb[i].AVG_VALUE;
            }
            if (a == undefined || b == undefined) {
                var table = "<h3 style='margin-top: 200px;padding-left: 340px;'>" + "暂无数据" + "</h3>";
                $("#database_gxnc_bfb").html(table);
            } else {
                if (DATE_TYPE == "showWeek") {
                    for (var i = 0; i < list.length; i++) {
                        x_value = list[i].DATA_TIME.split("-");
                        xdata.push(x_value[2]);
                        ydata1.push(list[i].AVG_VALUE);
                        ydata2.push(listTb[i].AVG_VALUE);
                        ydata3.push(listHb[i].AVG_VALUE);
                    }
                } else if (DATE_TYPE == "showMonth") {
                    for (var i = 0; i < list.length; i++) {
                        x_value = list[i].DATA_TIME.split("-");
                        xdata.push(x_value[2]);
                        ydata1.push(list[i].AVG_VALUE);
                        ydata2.push(listTb[i].AVG_VALUE);
                        ydata3.push(listHb[i].AVG_VALUE);
                    }
                    /*  option.xAxis.axisLabel.formatter='{value} d';*/
                } else if (DATE_TYPE == "showYear") {
                    for (var i = 0; i < list.length; i++) {
                        // xdata.push(list[i].DATA_TIME);
                        x_value = list[i].DATA_TIME.split("-");
                        xdata.push(x_value[1]);
                        ydata1.push(list[i].AVG_VALUE);
                        ydata2.push(listTb[i].AVG_VALUE);
                        /* ydata3.push(listHb[i].AVG_VALUE);*/
                    }
                } else {
                    for (var i = 0; i < list.length; i++) {
                        x_value = list[i].DATA_TIME.replace(' ', '-').split("-");
                        xdata.push(x_value[3]);
                        ydata1.push(list[i].AVG_VALUE);
                        ydata2.push(listTb[i].AVG_VALUE);
                        ydata3.push(listHb[i].AVG_VALUE);
                    }
                }
                option = {
                    tooltip: {
                        trigger: 'axis',
                    },
                    legend: {
                        data: ['昨日', '同比', '环比'],
                        textStyle: {
                            color: '#AAAAAA'
                        }
                    },
                    grid: {
                        left: '3%',
                        right: '4%',
                        bottom: '3%',
                        containLabel: true
                    },
                    xAxis: [{
                        type: 'category',
                        boundaryGap: false,
                        axisLabel: {
                            /*formatter:'{value} h',*/
                            textStyle: {
                                color: '#AAAAAA'
                            }
                        },
                        data: xdata
                    }],
                    yAxis: [{
                        type: 'value',
                        max: 100,//Y轴最大值 不写的话自动调节
                        axisLabel: {
                            formatter: '{value} %',
                            textStyle: {
                                color: '#AAAAAA'
                            }
                        }
                    }],
                    series: [
                        {
                            name: '昨日',
                            type: 'line',
                            color: '#EFB700',
                            data: ydata1
                        },
                        {
                            name: '同比',
                            type: 'line',
                            color: '#FF0A0E',
                            data: ydata2
                        },
                        {
                            name: '环比',
                            type: 'line',
                            color: '#0AFFBD',
                            data: ydata3
                        }
                    ]
                };
                database_gxnc_bfb.setOption(option);
            }
        }, error: function (textStatus) {
            console.log("error:" + textStatus.status);
        }
    });
}


//数据缓存区命中率区间分布
//PM-00-03-009-07
function queryDataBaseGxncDzt() {

    $.ajax({
        url: ctx + "/load/queryNum",
        type: "post",
        data: "DATE_TYPE=" + DATE_TYPE + "&EXT_UNIT_ID=" + EXT_UNIT_ID + "&KPI_CODE=" + "KPI-oracle-all-38" + "&CLASS_NAME=" + CLASS_NAME,
        success: function (data) {
            var memoryNum = JSON.parse(data);
            var xdata = [];
            var num1 = '';
            var min_value = '';
            var max_value = '';
            var group = '';
            var p = [];
            var values = [];
            var result = [0, 0, 0, 0, 0];
            var temp = '';
            var temp1 = '';
            var hkh = '';
            var myMap = new Map();
            var sum = 0;
            for (var i = 0; i < memoryNum.length; i++) {
                var a = memoryNum[i].GROUP_VALUE;
            }
            if (a == undefined) {
                var table = "<h3 style='margin-top: 200px;padding-left: 340px;'>" + "暂无数据" + "</h3>";
                $("#database_gxnc_slgl").html(table);
            } else {
                if (DATE_TYPE != "showYear") {//，分割分完的截取每个元素的倒数第一个或者第二个双引号的值{"0.0~20.0":"289"，"20.0~40.0":"290，"40.0~60.0":"291"}
                    for (var i = 0; i < memoryNum.length; i++) {
                        hkh = memoryNum[i].GROUP_VALUE.substring(1, memoryNum[i].GROUP_VALUE.lastIndexOf('}'));
                        num1 = hkh.split(',');
                        min_value = memoryNum[i].Y_MIN_VALUE;
                        max_value = memoryNum[i].Y_MAX_VALUE;
                        group = memoryNum[i].VALUE_GROUP;
                        for (j = 0; j < num1.length; j++) {
                            temp = num1[j].substring(num1[j].lastIndexOf(':"') + 2, num1[j].lastIndexOf('"'));
                            temp1 = num1[j].substring(1, num1[j].lastIndexOf('":'));
                            myMap.set(temp1, temp);
                        }
                        if (myMap.get("0.0~20.0") != null) {
                            xdata.push(myMap.get("0.0~20.0"));
                        } else {
                            xdata.push(0);
                        }
                        if (myMap.get("20.0~40.0") != null) {
                            xdata.push(myMap.get("20.0~40.0"));
                        } else {
                            xdata.push(0);
                        }
                        if (myMap.get("40.0~60.0") != null) {
                            xdata.push(myMap.get("40.0~60.0"));
                        } else {
                            xdata.push(0);
                        }
                        if (myMap.get("60.0~80.0") != null) {
                            xdata.push(myMap.get("60.0~80.0"));
                        } else {
                            xdata.push(0);
                        }
                        if (myMap.get("80.0~100.0") != null) {
                            xdata.push(myMap.get("80.0~100.0"));
                        } else {
                            xdata.push(0);
                        }
                    }
                } else {
                    for (var i = 0; i < memoryNum.length; i++) {
                        hkh = memoryNum[i].GROUP_VALUE.substring(1, memoryNum[i].GROUP_VALUE.lastIndexOf('}'));
                        num1 = hkh.split(',');
                        min_value = memoryNum[i].Y_MIN_VALUE;
                        max_value = memoryNum[i].Y_MAX_VALUE;
                        group = memoryNum[i].VALUE_GROUP;
                        for (var j = 0; j < num1.length; j++) {
                            temp = num1[j].substring(num1[j].lastIndexOf(':"') + 2, num1[j].lastIndexOf('"'));
                            temp1 = num1[j].substring(1, num1[j].lastIndexOf('":'));
                            if (temp) {
                                sum = parseInt(sum) + parseInt(temp);
                            }
                            myMap.set(temp1, sum);
                        }
                    }
                    if (myMap.get("0.0~20.0") != null) {
                        xdata.push(myMap.get("0.0~20.0"));
                    } else {
                        xdata.push(0);
                    }
                    if (myMap.get("20.0~40.0") != null) {
                        xdata.push(myMap.get("20.0~40.0"));
                    } else {
                        xdata.push(0);
                    }
                    if (myMap.get("40.0~60.0") != null) {
                        xdata.push(myMap.get("40.0~60.0"));
                    } else {
                        xdata.push(0);
                    }
                    if (myMap.get("60.0~80.0") != null) {
                        xdata.push(myMap.get("60.0~80.0"));
                    } else {
                        xdata.push(0);
                    }
                    if (myMap.get("80.0~100.0") != null) {
                        xdata.push(myMap.get("80.0~100.0"));
                    } else {
                        xdata.push(0);
                    }
                }
                option = {
                    color: ['#23CBFE'],
                    title: {
                        text: '',
                        subtext: ''
                    },
                    tooltip: {
                        trigger: 'axis',
                        axisPointer: {
                            type: 'shadow'
                        }
                    },
                    legend: {
                        data: ['数据缓存区命中率区间分布'],
                        textStyle: {
                            color: '#AAAAAA'
                        }
                    },
                    grid: {
                        left: '3%',
                        right: '4%',
                        bottom: '3%',
                        containLabel: true
                    },
                    xAxis: {
                        type: 'value',
                        boundaryGap: [0, 0.01],
                        splitLine: {
                            show: false
                        },
                        axisLabel: {
                            textStyle: {
                                color: '#AAAAAA'
                            }
                        }
                    },
                    yAxis: {
                        type: 'category',
                        splitLine: {
                            show: true
                        },
                        axisLabel: {
                            /* formatter:'{value} %',*/
                            textStyle: {
                                color: '#AAAAAA'
                            }
                        },
                        data: [
                            (100 - 0) / 5,
                            (100 - 0) / 5 * 2,
                            (100 - 0) / 5 * 3,
                            (100 - 0) / 5 * 4,
                            (100 - 0) / 5 * 5,
                        ]
                    },
                    series: [
                        {
                            name: '数据缓存区命中率区间分布',
                            type: 'bar',
                            barWidth: 30,
                            data: xdata
                        }
                    ]

                };
                database_gxnc_slgl.setOption(option);
            }
        }, error: function (textStatus) {
            console.log("error:" + textStatus.status);
        }
    });
}


//共享池缓存命中率
//PM-00-03-001-02
function queryDataBaseReadZxt() {

    $.ajax({
        url: ctx + "/load/queryLoad",
        type: "post",
        data: "EXT_UNIT_ID=" + EXT_UNIT_ID + "&KPI_CODE=" + "KPI-oracle-all-39" + "&DATE_TYPE=" + DATE_TYPE + "&CLASS_NAME=" + CLASS_NAME,
        success: function (data) {
            var map = JSON.parse(data);
            var list = map.list;
            var listTb = map.listTb;
            var listHb = map.listHb;
            var xdata = [];
            var ydata1 = [];
            var ydata2 = [];
            var ydata3 = [];
            var x_value = [];
            for (var i = 0; i < list.length; i++) {
                var a = list[i].AVG_VALUE;
                var b = listTb[i].AVG_VALUE;
                // var c = listHb[i].AVG_VALUE;
            }
            if (a == undefined || b == undefined) {
                var table = "<h3 style='margin-top: 200px;padding-left: 340px;'>" + "暂无数据" + "</h3>";
                $("#database_read").html(table);
            } else {
                if (DATE_TYPE == "showWeek") {
                    for (var i = 0; i < list.length; i++) {
                        x_value = list[i].DATA_TIME.split("-");
                        xdata.push(x_value[2]);
                        ydata1.push(list[i].AVG_VALUE);
                        ydata2.push(listTb[i].AVG_VALUE);
                        ydata3.push(listHb[i].AVG_VALUE);
                    }
                } else if (DATE_TYPE == "showMonth") {
                    for (var i = 0; i < list.length; i++) {
                        x_value = list[i].DATA_TIME.split("-");
                        xdata.push(x_value[2]);
                        ydata1.push(list[i].AVG_VALUE);
                        ydata2.push(listTb[i].AVG_VALUE);
                        ydata3.push(listHb[i].AVG_VALUE);
                    }
                    /*  option.xAxis.axisLabel.formatter='{value} d';*/
                } else if (DATE_TYPE == "showYear") {
                    for (var i = 0; i < list.length; i++) {
                        // xdata.push(list[i].DATA_TIME);
                        x_value = list[i].DATA_TIME.split("-");
                        xdata.push(x_value[1]);
                        ydata1.push(list[i].AVG_VALUE);
                        ydata2.push(listTb[i].AVG_VALUE);
                        /*ydata3.push(listHb[i].AVG_VALUE);*/
                    }
                } else {
                    for (var i = 0; i < list.length; i++) {
                        x_value = list[i].DATA_TIME.replace(' ', '-').split("-");
                        xdata.push(x_value[3]);
                        ydata1.push(list[i].AVG_VALUE);
                        ydata2.push(listTb[i].AVG_VALUE);
                        ydata3.push(listHb[i].AVG_VALUE);
                    }
                }
                option = {
                    tooltip: {
                        trigger: 'axis',
                    },
                    legend: {
                        data: ['昨日', '同比', '环比'],
                        textStyle: {
                            color: '#AAAAAA'
                        }
                    },
                    grid: {
                        left: '3%',
                        right: '4%',
                        bottom: '3%',
                        containLabel: true
                    },
                    xAxis: [{
                        type: 'category',
                        boundaryGap: false,
                        axisLabel: {
                            /*formatter:'{value} h',*/
                            textStyle: {
                                color: '#AAAAAA'
                            }
                        },
                        data: xdata
                    }],
                    yAxis: [{
                        type: 'value',
                        max: 100,//Y轴最大值 不写的话自动调节
                        axisLabel: {
                            formatter: '{value} %',
                            textStyle: {
                                color: '#AAAAAA'
                            }
                        }
                    }],
                    series: [
                        {
                            name: '昨日',
                            type: 'line',
                            color: '#EFB700',
                            data: ydata1
                        },
                        {
                            name: '同比',
                            type: 'line',
                            color: '#FF0A0E',
                            data: ydata2
                        },
                        {
                            name: '环比',
                            type: 'line',
                            color: '#0AFFBD',
                            data: ydata3
                        }
                    ]
                };
                database_read.setOption(option);
            }
        }, error: function (textStatus) {
            console.log("error:" + textStatus.status);
        }
    });
}


//共享池缓存命中率区间分布
//PM-00-03-001-02
function queryDataBaseReadDzt() {
    $.ajax({
        url: ctx + "/load/queryNum",
        type: "post",
        data: "DATE_TYPE=" + DATE_TYPE + "&EXT_UNIT_ID=" + EXT_UNIT_ID + "&KPI_CODE=" + "KPI-oracle-all-39" + "&CLASS_NAME=" + CLASS_NAME,
        success: function (data) {
            var memoryNum = JSON.parse(data);
            var xdata = [];
            var num1 = '';
            var min_value = '';
            var max_value = '';
            var group = '';
            var p = [];
            var values = [];
            var result = [0, 0, 0, 0, 0];
            var temp = '';
            var temp1 = '';
            var hkh = '';
            var myMap = new Map();
            var sum = 0;
            for (var i = 0; i < memoryNum.length; i++) {
                var a = memoryNum[i].GROUP_VALUE;
            }
            if (a == undefined) {
                var table = "<h3 style='margin-top: 200px;padding-left: 340px;'>" + "暂无数据" + "</h3>";
                $("#database_read_gl").html(table);
            } else {
                if (DATE_TYPE != "showYear") {//，分割分完的截取每个元素的倒数第一个或者第二个双引号的值{"0.0~20.0":"289"，"20.0~40.0":"290，"40.0~60.0":"291"}
                    for (var i = 0; i < memoryNum.length; i++) {
                        hkh = memoryNum[i].GROUP_VALUE.substring(1, memoryNum[i].GROUP_VALUE.lastIndexOf('}'));
                        num1 = hkh.split(',');
                        min_value = memoryNum[i].Y_MIN_VALUE;
                        max_value = memoryNum[i].Y_MAX_VALUE;
                        group = memoryNum[i].VALUE_GROUP;
                        for (j = 0; j < num1.length; j++) {
                            temp = num1[j].substring(num1[j].lastIndexOf(':"') + 2, num1[j].lastIndexOf('"'));
                            temp1 = num1[j].substring(1, num1[j].lastIndexOf('":'));
                            myMap.set(temp1, temp);
                        }
                        if (myMap.get("0.0~20.0") != null) {
                            xdata.push(myMap.get("0.0~20.0"));
                        } else {
                            xdata.push(0);
                        }
                        if (myMap.get("20.0~40.0") != null) {
                            xdata.push(myMap.get("20.0~40.0"));
                        } else {
                            xdata.push(0);
                        }
                        if (myMap.get("40.0~60.0") != null) {
                            xdata.push(myMap.get("40.0~60.0"));
                        } else {
                            xdata.push(0);
                        }
                        if (myMap.get("60.0~80.0") != null) {
                            xdata.push(myMap.get("60.0~80.0"));
                        } else {
                            xdata.push(0);
                        }
                        if (myMap.get("80.0~100.0") != null) {
                            xdata.push(myMap.get("80.0~100.0"));
                        } else {
                            xdata.push(0);
                        }
                    }
                } else {
                    for (var i = 0; i < memoryNum.length; i++) {
                        hkh = memoryNum[i].GROUP_VALUE.substring(1, memoryNum[i].GROUP_VALUE.lastIndexOf('}'));
                        num1 = hkh.split(',');
                        min_value = memoryNum[i].Y_MIN_VALUE;
                        max_value = memoryNum[i].Y_MAX_VALUE;
                        group = memoryNum[i].VALUE_GROUP;
                        for (var j = 0; j < num1.length; j++) {
                            temp = num1[j].substring(num1[j].lastIndexOf(':"') + 2, num1[j].lastIndexOf('"'));
                            temp1 = num1[j].substring(1, num1[j].lastIndexOf('":'));
                            if (temp) {
                                sum = parseInt(sum) + parseInt(temp);
                            }
                            myMap.set(temp1, sum);
                        }
                    }
                    if (myMap.get("0.0~20.0") != null) {
                        xdata.push(myMap.get("0.0~20.0"));
                    } else {
                        xdata.push(0);
                    }
                    if (myMap.get("20.0~40.0") != null) {
                        xdata.push(myMap.get("20.0~40.0"));
                    } else {
                        xdata.push(0);
                    }
                    if (myMap.get("40.0~60.0") != null) {
                        xdata.push(myMap.get("40.0~60.0"));
                    } else {
                        xdata.push(0);
                    }
                    if (myMap.get("60.0~80.0") != null) {
                        xdata.push(myMap.get("60.0~80.0"));
                    } else {
                        xdata.push(0);
                    }
                    if (myMap.get("80.0~100.0") != null) {
                        xdata.push(myMap.get("80.0~100.0"));
                    } else {
                        xdata.push(0);
                    }
                }
                option = {
                    color: ['#23CBFE'],
                    title: {
                        text: '',
                        subtext: ''
                    },
                    tooltip: {
                        trigger: 'axis',
                        axisPointer: {
                            type: 'shadow'
                        }
                    },
                    legend: {
                        data: ['共享池缓存命中率区间分布'],
                        textStyle: {
                            color: '#AAAAAA'
                        }
                    },
                    grid: {
                        left: '3%',
                        right: '4%',
                        bottom: '3%',
                        containLabel: true
                    },
                    xAxis: {
                        type: 'value',
                        boundaryGap: [0, 0.01],
                        splitLine: {
                            show: false
                        },
                        axisLabel: {
                            textStyle: {
                                color: '#AAAAAA'
                            }
                        }
                    },
                    yAxis: {
                        type: 'category',
                        splitLine: {
                            show: true
                        },
                        axisLabel: {
                            /* formatter:'{value} %',*/
                            textStyle: {
                                color: '#AAAAAA'
                            }
                        },
                        data: [
                            (100 - 0) / 5,
                            (100 - 0) / 5 * 2,
                            (100 - 0) / 5 * 3,
                            (100 - 0) / 5 * 4,
                            (100 - 0) / 5 * 5,
                        ]
                    },
                    series: [
                        {
                            name: '共享池缓存命中率区间分布',
                            type: 'bar',
                            barWidth: 30,
                            data: xdata
                        }
                    ]

                };
                database_read_gl.setOption(option);
            }
        }, error: function (textStatus) {
            console.log("error:" + textStatus.status);
        }
    });
}

//数据字典缓存命中率
//PM-00-03-001-02
function queryDataBase_sjzdhc_mzl() {

    $.ajax({
        url: ctx + "/load/queryLoad",
        type: "post",
        data: "EXT_UNIT_ID=" + EXT_UNIT_ID + "&KPI_CODE=" + "KPI-oracle-all-40" + "&DATE_TYPE=" + DATE_TYPE + "&CLASS_NAME=" + CLASS_NAME,
        success: function (data) {
            var map = JSON.parse(data);
            var list = map.list;
            var listTb = map.listTb;
            var listHb = map.listHb;
            var xdata = [];
            var ydata1 = [];
            var ydata2 = [];
            var ydata3 = [];
            var x_value = [];
            for (var i = 0; i < list.length; i++) {
                var a = list[i].AVG_VALUE;
                var b = listTb[i].AVG_VALUE;
                // var c = listHb[i].AVG_VALUE;
            }
            if (a == undefined || b == undefined) {
                var table = "<h3 style='margin-top: 200px;padding-left: 340px;'>" + "暂无数据" + "</h3>";
                $("#database_read").html(table);
            } else {
                if (DATE_TYPE == "showWeek") {
                    for (var i = 0; i < list.length; i++) {
                        x_value = list[i].DATA_TIME.split("-");
                        xdata.push(x_value[2]);
                        ydata1.push(list[i].AVG_VALUE);
                        ydata2.push(listTb[i].AVG_VALUE);
                        ydata3.push(listHb[i].AVG_VALUE);
                    }
                } else if (DATE_TYPE == "showMonth") {
                    for (var i = 0; i < list.length; i++) {
                        x_value = list[i].DATA_TIME.split("-");
                        xdata.push(x_value[2]);
                        ydata1.push(list[i].AVG_VALUE);
                        ydata2.push(listTb[i].AVG_VALUE);
                        ydata3.push(listHb[i].AVG_VALUE);
                    }
                    /*  option.xAxis.axisLabel.formatter='{value} d';*/
                } else if (DATE_TYPE == "showYear") {
                    for (var i = 0; i < list.length; i++) {
                        // xdata.push(list[i].DATA_TIME);
                        x_value = list[i].DATA_TIME.split("-");
                        xdata.push(x_value[1]);
                        ydata1.push(list[i].AVG_VALUE);
                        ydata2.push(listTb[i].AVG_VALUE);
                        /*ydata3.push(listHb[i].AVG_VALUE);*/
                    }
                } else {
                    for (var i = 0; i < list.length; i++) {
                        x_value = list[i].DATA_TIME.replace(' ', '-').split("-");
                        xdata.push(x_value[3]);
                        ydata1.push(list[i].AVG_VALUE);
                        ydata2.push(listTb[i].AVG_VALUE);
                        ydata3.push(listHb[i].AVG_VALUE);
                    }
                }
                option = {
                    tooltip: {
                        trigger: 'axis',
                    },
                    legend: {
                        data: ['昨日', '同比', '环比'],
                        textStyle: {
                            color: '#AAAAAA'
                        }
                    },
                    grid: {
                        left: '3%',
                        right: '4%',
                        bottom: '3%',
                        containLabel: true
                    },
                    xAxis: [{
                        type: 'category',
                        boundaryGap: false,
                        axisLabel: {
                            /*formatter:'{value} h',*/
                            textStyle: {
                                color: '#AAAAAA'
                            }
                        },
                        data: xdata
                    }],
                    yAxis: [{
                        type: 'value',
                        max: 100,//Y轴最大值 不写的话自动调节
                        axisLabel: {
                            formatter: '{value} %',
                            textStyle: {
                                color: '#AAAAAA'
                            }
                        }
                    }],
                    series: [
                        {
                            name: '昨日',
                            type: 'line',
                            color: '#EFB700',
                            data: ydata1
                        },
                        {
                            name: '同比',
                            type: 'line',
                            color: '#FF0A0E',
                            data: ydata2
                        },
                        {
                            name: '环比',
                            type: 'line',
                            color: '#0AFFBD',
                            data: ydata3
                        }
                    ]
                };
                database_sjzdhc_mzl.setOption(option);
            }
        }, error: function (textStatus) {
            console.log("error:" + textStatus.status);
        }
    });
}


//数据字典缓存命中率区间分布
//PM-00-03-001-02
function queryDataBase_sjzdhc_mzl_qjfb() {
    $.ajax({
        url: ctx + "/load/queryNum",
        type: "post",
        data: "DATE_TYPE=" + DATE_TYPE + "&EXT_UNIT_ID=" + EXT_UNIT_ID + "&KPI_CODE=" + "KPI-oracle-all-40" + "&CLASS_NAME=" + CLASS_NAME,
        success: function (data) {
            var memoryNum = JSON.parse(data);
            var xdata = [];
            var num1 = '';
            var min_value = '';
            var max_value = '';
            var group = '';
            var p = [];
            var values = [];
            var result = [0, 0, 0, 0, 0];
            var temp = '';
            var temp1 = '';
            var hkh = '';
            var myMap = new Map();
            var sum = 0;
            for (var i = 0; i < memoryNum.length; i++) {
                var a = memoryNum[i].GROUP_VALUE;
            }
            if (a == undefined) {
                var table = "<h3 style='margin-top: 200px;padding-left: 340px;'>" + "暂无数据" + "</h3>";
                $("#database_read_gl").html(table);
            } else {
                if (DATE_TYPE != "showYear") {//，分割分完的截取每个元素的倒数第一个或者第二个双引号的值{"0.0~20.0":"289"，"20.0~40.0":"290，"40.0~60.0":"291"}
                    for (var i = 0; i < memoryNum.length; i++) {
                        hkh = memoryNum[i].GROUP_VALUE.substring(1, memoryNum[i].GROUP_VALUE.lastIndexOf('}'));
                        num1 = hkh.split(',');
                        min_value = memoryNum[i].Y_MIN_VALUE;
                        max_value = memoryNum[i].Y_MAX_VALUE;
                        group = memoryNum[i].VALUE_GROUP;
                        for (j = 0; j < num1.length; j++) {
                            temp = num1[j].substring(num1[j].lastIndexOf(':"') + 2, num1[j].lastIndexOf('"'));
                            temp1 = num1[j].substring(1, num1[j].lastIndexOf('":'));
                            myMap.set(temp1, temp);
                        }
                        if (myMap.get("0.0~20.0") != null) {
                            xdata.push(myMap.get("0.0~20.0"));
                        } else {
                            xdata.push(0);
                        }
                        if (myMap.get("20.0~40.0") != null) {
                            xdata.push(myMap.get("20.0~40.0"));
                        } else {
                            xdata.push(0);
                        }
                        if (myMap.get("40.0~60.0") != null) {
                            xdata.push(myMap.get("40.0~60.0"));
                        } else {
                            xdata.push(0);
                        }
                        if (myMap.get("60.0~80.0") != null) {
                            xdata.push(myMap.get("60.0~80.0"));
                        } else {
                            xdata.push(0);
                        }
                        if (myMap.get("80.0~100.0") != null) {
                            xdata.push(myMap.get("80.0~100.0"));
                        } else {
                            xdata.push(0);
                        }
                    }
                } else {
                    for (var i = 0; i < memoryNum.length; i++) {
                        hkh = memoryNum[i].GROUP_VALUE.substring(1, memoryNum[i].GROUP_VALUE.lastIndexOf('}'));
                        num1 = hkh.split(',');
                        min_value = memoryNum[i].Y_MIN_VALUE;
                        max_value = memoryNum[i].Y_MAX_VALUE;
                        group = memoryNum[i].VALUE_GROUP;
                        for (var j = 0; j < num1.length; j++) {
                            temp = num1[j].substring(num1[j].lastIndexOf(':"') + 2, num1[j].lastIndexOf('"'));
                            temp1 = num1[j].substring(1, num1[j].lastIndexOf('":'));
                            if (temp) {
                                sum = parseInt(sum) + parseInt(temp);
                            }
                            myMap.set(temp1, sum);
                        }
                    }
                    if (myMap.get("0.0~20.0") != null) {
                        xdata.push(myMap.get("0.0~20.0"));
                    } else {
                        xdata.push(0);
                    }
                    if (myMap.get("20.0~40.0") != null) {
                        xdata.push(myMap.get("20.0~40.0"));
                    } else {
                        xdata.push(0);
                    }
                    if (myMap.get("40.0~60.0") != null) {
                        xdata.push(myMap.get("40.0~60.0"));
                    } else {
                        xdata.push(0);
                    }
                    if (myMap.get("60.0~80.0") != null) {
                        xdata.push(myMap.get("60.0~80.0"));
                    } else {
                        xdata.push(0);
                    }
                    if (myMap.get("80.0~100.0") != null) {
                        xdata.push(myMap.get("80.0~100.0"));
                    } else {
                        xdata.push(0);
                    }
                }
                option = {
                    color: ['#23CBFE'],
                    title: {
                        text: '',
                        subtext: ''
                    },
                    tooltip: {
                        trigger: 'axis',
                        axisPointer: {
                            type: 'shadow'
                        }
                    },
                    legend: {
                        data: ['数据字典缓存命中率区间分布'],
                        textStyle: {
                            color: '#AAAAAA'
                        }
                    },
                    grid: {
                        left: '3%',
                        right: '4%',
                        bottom: '3%',
                        containLabel: true
                    },
                    xAxis: {
                        type: 'value',
                        boundaryGap: [0, 0.01],
                        splitLine: {
                            show: false
                        },
                        axisLabel: {
                            textStyle: {
                                color: '#AAAAAA'
                            }
                        }
                    },
                    yAxis: {
                        type: 'category',
                        splitLine: {
                            show: true
                        },
                        axisLabel: {
                            /* formatter:'{value} %',*/
                            textStyle: {
                                color: '#AAAAAA'
                            }
                        },
                        data: [
                            (100 - 0) / 5,
                            (100 - 0) / 5 * 2,
                            (100 - 0) / 5 * 3,
                            (100 - 0) / 5 * 4,
                            (100 - 0) / 5 * 5,
                        ]
                    },
                    series: [
                        {
                            name: '数据字典缓存命中率区间分布',
                            type: 'bar',
                            barWidth: 30,
                            data: xdata
                        }
                    ]

                };
                database_sjzdhc_mzl_qjfb.setOption(option);
            }
        }, error: function (textStatus) {
            console.log("error:" + textStatus.status);
        }
    });
}

//回滚段命中率
//PM-00-03-001-02
function queryDataBase_hgd_mzl() {

    $.ajax({
        url: ctx + "/load/queryLoad",
        type: "post",
        data: "EXT_UNIT_ID=" + EXT_UNIT_ID + "&KPI_CODE=" + "KPI-oracle-all-41" + "&DATE_TYPE=" + DATE_TYPE + "&CLASS_NAME=" + CLASS_NAME,
        success: function (data) {
            var map = JSON.parse(data);
            var list = map.list;
            var listTb = map.listTb;
            var listHb = map.listHb;
            var xdata = [];
            var ydata1 = [];
            var ydata2 = [];
            var ydata3 = [];
            var x_value = [];
            for (var i = 0; i < list.length; i++) {
                var a = list[i].AVG_VALUE;
                var b = listTb[i].AVG_VALUE;
                // var c = listHb[i].AVG_VALUE;
            }
            if (a == undefined || b == undefined) {
                var table = "<h3 style='margin-top: 200px;padding-left: 340px;'>" + "暂无数据" + "</h3>";
                $("#database_read").html(table);
            } else {
                if (DATE_TYPE == "showWeek") {
                    for (var i = 0; i < list.length; i++) {
                        x_value = list[i].DATA_TIME.split("-");
                        xdata.push(x_value[2]);
                        ydata1.push(list[i].AVG_VALUE);
                        ydata2.push(listTb[i].AVG_VALUE);
                        ydata3.push(listHb[i].AVG_VALUE);
                    }
                } else if (DATE_TYPE == "showMonth") {
                    for (var i = 0; i < list.length; i++) {
                        x_value = list[i].DATA_TIME.split("-");
                        xdata.push(x_value[2]);
                        ydata1.push(list[i].AVG_VALUE);
                        ydata2.push(listTb[i].AVG_VALUE);
                        ydata3.push(listHb[i].AVG_VALUE);
                    }
                    /*  option.xAxis.axisLabel.formatter='{value} d';*/
                } else if (DATE_TYPE == "showYear") {
                    for (var i = 0; i < list.length; i++) {
                        // xdata.push(list[i].DATA_TIME);
                        x_value = list[i].DATA_TIME.split("-");
                        xdata.push(x_value[1]);
                        ydata1.push(list[i].AVG_VALUE);
                        ydata2.push(listTb[i].AVG_VALUE);
                        /*ydata3.push(listHb[i].AVG_VALUE);*/
                    }
                } else {
                    for (var i = 0; i < list.length; i++) {
                        x_value = list[i].DATA_TIME.replace(' ', '-').split("-");
                        xdata.push(x_value[3]);
                        ydata1.push(list[i].AVG_VALUE);
                        ydata2.push(listTb[i].AVG_VALUE);
                        ydata3.push(listHb[i].AVG_VALUE);
                    }
                }
                option = {
                    tooltip: {
                        trigger: 'axis',
                    },
                    legend: {
                        data: ['昨日', '同比', '环比'],
                        textStyle: {
                            color: '#AAAAAA'
                        }
                    },
                    grid: {
                        left: '3%',
                        right: '4%',
                        bottom: '3%',
                        containLabel: true
                    },
                    xAxis: [{
                        type: 'category',
                        boundaryGap: false,
                        axisLabel: {
                            /*formatter:'{value} h',*/
                            textStyle: {
                                color: '#AAAAAA'
                            }
                        },
                        data: xdata
                    }],
                    yAxis: [{
                        type: 'value',
                        max: 100,//Y轴最大值 不写的话自动调节
                        axisLabel: {
                            formatter: '{value} %',
                            textStyle: {
                                color: '#AAAAAA'
                            }
                        }
                    }],
                    series: [
                        {
                            name: '昨日',
                            type: 'line',
                            color: '#EFB700',
                            data: ydata1
                        },
                        {
                            name: '同比',
                            type: 'line',
                            color: '#FF0A0E',
                            data: ydata2
                        },
                        {
                            name: '环比',
                            type: 'line',
                            color: '#0AFFBD',
                            data: ydata3
                        }
                    ]
                };
                database_hgd_mzl.setOption(option);
            }
        }, error: function (textStatus) {
            console.log("error:" + textStatus.status);
        }
    });
}

//回滚段命中率
//PM-00-03-001-02
function queryDataBase_hgd_mzl_qjfb() {
    $.ajax({
        url: ctx + "/load/queryNum",
        type: "post",
        data: "DATE_TYPE=" + DATE_TYPE + "&EXT_UNIT_ID=" + EXT_UNIT_ID + "&KPI_CODE=" + "KPI-oracle-all-41" + "&CLASS_NAME=" + CLASS_NAME,
        success: function (data) {
            var memoryNum = JSON.parse(data);
            var xdata = [];
            var num1 = '';
            var min_value = '';
            var max_value = '';
            var group = '';
            var p = [];
            var values = [];
            var result = [0, 0, 0, 0, 0];
            var temp = '';
            var temp1 = '';
            var hkh = '';
            var myMap = new Map();
            var sum = 0;
            for (var i = 0; i < memoryNum.length; i++) {
                var a = memoryNum[i].GROUP_VALUE;
            }
            if (a == undefined) {
                var table = "<h3 style='margin-top: 200px;padding-left: 340px;'>" + "暂无数据" + "</h3>";
                $("#database_read_gl").html(table);
            } else {
                if (DATE_TYPE != "showYear") {//，分割分完的截取每个元素的倒数第一个或者第二个双引号的值{"0.0~20.0":"289"，"20.0~40.0":"290，"40.0~60.0":"291"}
                    for (var i = 0; i < memoryNum.length; i++) {
                        hkh = memoryNum[i].GROUP_VALUE.substring(1, memoryNum[i].GROUP_VALUE.lastIndexOf('}'));
                        num1 = hkh.split(',');
                        min_value = memoryNum[i].Y_MIN_VALUE;
                        max_value = memoryNum[i].Y_MAX_VALUE;
                        group = memoryNum[i].VALUE_GROUP;
                        for (j = 0; j < num1.length; j++) {
                            temp = num1[j].substring(num1[j].lastIndexOf(':"') + 2, num1[j].lastIndexOf('"'));
                            temp1 = num1[j].substring(1, num1[j].lastIndexOf('":'));
                            myMap.set(temp1, temp);
                        }
                        if (myMap.get("0.0~20.0") != null) {
                            xdata.push(myMap.get("0.0~20.0"));
                        } else {
                            xdata.push(0);
                        }
                        if (myMap.get("20.0~40.0") != null) {
                            xdata.push(myMap.get("20.0~40.0"));
                        } else {
                            xdata.push(0);
                        }
                        if (myMap.get("40.0~60.0") != null) {
                            xdata.push(myMap.get("40.0~60.0"));
                        } else {
                            xdata.push(0);
                        }
                        if (myMap.get("60.0~80.0") != null) {
                            xdata.push(myMap.get("60.0~80.0"));
                        } else {
                            xdata.push(0);
                        }
                        if (myMap.get("80.0~100.0") != null) {
                            xdata.push(myMap.get("80.0~100.0"));
                        } else {
                            xdata.push(0);
                        }
                    }
                } else {
                    for (var i = 0; i < memoryNum.length; i++) {
                        hkh = memoryNum[i].GROUP_VALUE.substring(1, memoryNum[i].GROUP_VALUE.lastIndexOf('}'));
                        num1 = hkh.split(',');
                        min_value = memoryNum[i].Y_MIN_VALUE;
                        max_value = memoryNum[i].Y_MAX_VALUE;
                        group = memoryNum[i].VALUE_GROUP;
                        for (var j = 0; j < num1.length; j++) {
                            temp = num1[j].substring(num1[j].lastIndexOf(':"') + 2, num1[j].lastIndexOf('"'));
                            temp1 = num1[j].substring(1, num1[j].lastIndexOf('":'));
                            if (temp) {
                                sum = parseInt(sum) + parseInt(temp);
                            }
                            myMap.set(temp1, sum);
                        }
                    }
                    if (myMap.get("0.0~20.0") != null) {
                        xdata.push(myMap.get("0.0~20.0"));
                    } else {
                        xdata.push(0);
                    }
                    if (myMap.get("20.0~40.0") != null) {
                        xdata.push(myMap.get("20.0~40.0"));
                    } else {
                        xdata.push(0);
                    }
                    if (myMap.get("40.0~60.0") != null) {
                        xdata.push(myMap.get("40.0~60.0"));
                    } else {
                        xdata.push(0);
                    }
                    if (myMap.get("60.0~80.0") != null) {
                        xdata.push(myMap.get("60.0~80.0"));
                    } else {
                        xdata.push(0);
                    }
                    if (myMap.get("80.0~100.0") != null) {
                        xdata.push(myMap.get("80.0~100.0"));
                    } else {
                        xdata.push(0);
                    }
                }
                option = {
                    color: ['#23CBFE'],
                    title: {
                        text: '',
                        subtext: ''
                    },
                    tooltip: {
                        trigger: 'axis',
                        axisPointer: {
                            type: 'shadow'
                        }
                    },
                    legend: {
                        data: ['回滚段命中率区间分布'],
                        textStyle: {
                            color: '#AAAAAA'
                        }
                    },
                    grid: {
                        left: '3%',
                        right: '4%',
                        bottom: '3%',
                        containLabel: true
                    },
                    xAxis: {
                        type: 'value',
                        boundaryGap: [0, 0.01],
                        splitLine: {
                            show: false
                        },
                        axisLabel: {
                            textStyle: {
                                color: '#AAAAAA'
                            }
                        }
                    },
                    yAxis: {
                        type: 'category',
                        splitLine: {
                            show: true
                        },
                        axisLabel: {
                            /* formatter:'{value} %',*/
                            textStyle: {
                                color: '#AAAAAA'
                            }
                        },
                        data: [
                            (100 - 0) / 5,
                            (100 - 0) / 5 * 2,
                            (100 - 0) / 5 * 3,
                            (100 - 0) / 5 * 4,
                            (100 - 0) / 5 * 5,
                        ]
                    },
                    series: [
                        {
                            name: '回滚段命中率区间分部',
                            type: 'bar',
                            barWidth: 30,
                            data: xdata
                        }
                    ]

                };
                database_hgd_mzl_qjfb.setOption(option);
            }
        }, error: function (textStatus) {
            console.log("error:" + textStatus.status);
        }
    });
}


//内存中排序占的比率
//PM-00-03-001-02
function queryDataBase_nczpx_mzl() {

    $.ajax({
        url: ctx + "/load/queryLoad",
        type: "post",
        data: "EXT_UNIT_ID=" + EXT_UNIT_ID + "&KPI_CODE=" + "KPI-oracle-all-42" + "&DATE_TYPE=" + DATE_TYPE + "&CLASS_NAME=" + CLASS_NAME,
        success: function (data) {
            var map = JSON.parse(data);
            var list = map.list;
            var listTb = map.listTb;
            var listHb = map.listHb;
            var xdata = [];
            var ydata1 = [];
            var ydata2 = [];
            var ydata3 = [];
            var x_value = [];
            for (var i = 0; i < list.length; i++) {
                var a = list[i].AVG_VALUE;
                var b = listTb[i].AVG_VALUE;
                // var c = listHb[i].AVG_VALUE;
            }
            if (a == undefined || b == undefined) {
                var table = "<h3 style='margin-top: 200px;padding-left: 340px;'>" + "暂无数据" + "</h3>";
                $("#database_read").html(table);
            } else {
                if (DATE_TYPE == "showWeek") {
                    for (var i = 0; i < list.length; i++) {
                        x_value = list[i].DATA_TIME.split("-");
                        xdata.push(x_value[2]);
                        ydata1.push(list[i].AVG_VALUE);
                        ydata2.push(listTb[i].AVG_VALUE);
                        ydata3.push(listHb[i].AVG_VALUE);
                    }
                } else if (DATE_TYPE == "showMonth") {
                    for (var i = 0; i < list.length; i++) {
                        x_value = list[i].DATA_TIME.split("-");
                        xdata.push(x_value[2]);
                        ydata1.push(list[i].AVG_VALUE);
                        ydata2.push(listTb[i].AVG_VALUE);
                        ydata3.push(listHb[i].AVG_VALUE);
                    }
                    /*  option.xAxis.axisLabel.formatter='{value} d';*/
                } else if (DATE_TYPE == "showYear") {
                    for (var i = 0; i < list.length; i++) {
                        // xdata.push(list[i].DATA_TIME);
                        x_value = list[i].DATA_TIME.split("-");
                        xdata.push(x_value[1]);
                        ydata1.push(list[i].AVG_VALUE);
                        ydata2.push(listTb[i].AVG_VALUE);
                        /*ydata3.push(listHb[i].AVG_VALUE);*/
                    }
                } else {
                    for (var i = 0; i < list.length; i++) {
                        x_value = list[i].DATA_TIME.replace(' ', '-').split("-");
                        xdata.push(x_value[3]);
                        ydata1.push(list[i].AVG_VALUE);
                        ydata2.push(listTb[i].AVG_VALUE);
                        ydata3.push(listHb[i].AVG_VALUE);
                    }
                }
                option = {
                    tooltip: {
                        trigger: 'axis',
                    },
                    legend: {
                        data: ['昨日', '同比', '环比'],
                        textStyle: {
                            color: '#AAAAAA'
                        }
                    },
                    grid: {
                        left: '3%',
                        right: '4%',
                        bottom: '3%',
                        containLabel: true
                    },
                    xAxis: [{
                        type: 'category',
                        boundaryGap: false,
                        axisLabel: {
                            /*formatter:'{value} h',*/
                            textStyle: {
                                color: '#AAAAAA'
                            }
                        },
                        data: xdata
                    }],
                    yAxis: [{
                        type: 'value',
                        max: 100,//Y轴最大值 不写的话自动调节
                        axisLabel: {
                            formatter: '{value} %',
                            textStyle: {
                                color: '#AAAAAA'
                            }
                        }
                    }],
                    series: [
                        {
                            name: '昨日',
                            type: 'line',
                            color: '#EFB700',
                            data: ydata1
                        },
                        {
                            name: '同比',
                            type: 'line',
                            color: '#FF0A0E',
                            data: ydata2
                        },
                        {
                            name: '环比',
                            type: 'line',
                            color: '#0AFFBD',
                            data: ydata3
                        }
                    ]
                };
                database_nczpx_mzl.setOption(option);
            }
        }, error: function (textStatus) {
            console.log("error:" + textStatus.status);
        }
    });
}

//内存中排序占的比率
//PM-00-03-001-02
function queryDataBase_nczpx_mzl_qjfb() {
    $.ajax({
        url: ctx + "/load/queryNum",
        type: "post",
        data: "DATE_TYPE=" + DATE_TYPE + "&EXT_UNIT_ID=" + EXT_UNIT_ID + "&KPI_CODE=" + "KPI-oracle-all-42" + "&CLASS_NAME=" + CLASS_NAME,
        success: function (data) {
            var memoryNum = JSON.parse(data);
            var xdata = [];
            var num1 = '';
            var min_value = '';
            var max_value = '';
            var group = '';
            var p = [];
            var values = [];
            var result = [0, 0, 0, 0, 0];
            var temp = '';
            var temp1 = '';
            var hkh = '';
            var myMap = new Map();
            var sum = 0;
            for (var i = 0; i < memoryNum.length; i++) {
                var a = memoryNum[i].GROUP_VALUE;
            }
            if (a == undefined) {
                var table = "<h3 style='margin-top: 200px;padding-left: 340px;'>" + "暂无数据" + "</h3>";
                $("#database_read_gl").html(table);
            } else {
                if (DATE_TYPE != "showYear") {//，分割分完的截取每个元素的倒数第一个或者第二个双引号的值{"0.0~20.0":"289"，"20.0~40.0":"290，"40.0~60.0":"291"}
                    for (var i = 0; i < memoryNum.length; i++) {
                        hkh = memoryNum[i].GROUP_VALUE.substring(1, memoryNum[i].GROUP_VALUE.lastIndexOf('}'));
                        num1 = hkh.split(',');
                        min_value = memoryNum[i].Y_MIN_VALUE;
                        max_value = memoryNum[i].Y_MAX_VALUE;
                        group = memoryNum[i].VALUE_GROUP;
                        for (j = 0; j < num1.length; j++) {
                            temp = num1[j].substring(num1[j].lastIndexOf(':"') + 2, num1[j].lastIndexOf('"'));
                            temp1 = num1[j].substring(1, num1[j].lastIndexOf('":'));
                            myMap.set(temp1, temp);
                        }
                        if (myMap.get("0.0~20.0") != null) {
                            xdata.push(myMap.get("0.0~20.0"));
                        } else {
                            xdata.push(0);
                        }
                        if (myMap.get("20.0~40.0") != null) {
                            xdata.push(myMap.get("20.0~40.0"));
                        } else {
                            xdata.push(0);
                        }
                        if (myMap.get("40.0~60.0") != null) {
                            xdata.push(myMap.get("40.0~60.0"));
                        } else {
                            xdata.push(0);
                        }
                        if (myMap.get("60.0~80.0") != null) {
                            xdata.push(myMap.get("60.0~80.0"));
                        } else {
                            xdata.push(0);
                        }
                        if (myMap.get("80.0~100.0") != null) {
                            xdata.push(myMap.get("80.0~100.0"));
                        } else {
                            xdata.push(0);
                        }
                    }
                } else {
                    for (var i = 0; i < memoryNum.length; i++) {
                        hkh = memoryNum[i].GROUP_VALUE.substring(1, memoryNum[i].GROUP_VALUE.lastIndexOf('}'));
                        num1 = hkh.split(',');
                        min_value = memoryNum[i].Y_MIN_VALUE;
                        max_value = memoryNum[i].Y_MAX_VALUE;
                        group = memoryNum[i].VALUE_GROUP;
                        for (var j = 0; j < num1.length; j++) {
                            temp = num1[j].substring(num1[j].lastIndexOf(':"') + 2, num1[j].lastIndexOf('"'));
                            temp1 = num1[j].substring(1, num1[j].lastIndexOf('":'));
                            if (temp) {
                                sum = parseInt(sum) + parseInt(temp);
                            }
                            myMap.set(temp1, sum);
                        }
                    }
                    if (myMap.get("0.0~20.0") != null) {
                        xdata.push(myMap.get("0.0~20.0"));
                    } else {
                        xdata.push(0);
                    }
                    if (myMap.get("20.0~40.0") != null) {
                        xdata.push(myMap.get("20.0~40.0"));
                    } else {
                        xdata.push(0);
                    }
                    if (myMap.get("40.0~60.0") != null) {
                        xdata.push(myMap.get("40.0~60.0"));
                    } else {
                        xdata.push(0);
                    }
                    if (myMap.get("60.0~80.0") != null) {
                        xdata.push(myMap.get("60.0~80.0"));
                    } else {
                        xdata.push(0);
                    }
                    if (myMap.get("80.0~100.0") != null) {
                        xdata.push(myMap.get("80.0~100.0"));
                    } else {
                        xdata.push(0);
                    }
                }
                option = {
                    color: ['#23CBFE'],
                    title: {
                        text: '',
                        subtext: ''
                    },
                    tooltip: {
                        trigger: 'axis',
                        axisPointer: {
                            type: 'shadow'
                        }
                    },
                    legend: {
                        data: ['内存中排序占的比率区间分布'],
                        textStyle: {
                            color: '#AAAAAA'
                        }
                    },
                    grid: {
                        left: '3%',
                        right: '4%',
                        bottom: '3%',
                        containLabel: true
                    },
                    xAxis: {
                        type: 'value',
                        boundaryGap: [0, 0.01],
                        splitLine: {
                            show: false
                        },
                        axisLabel: {
                            textStyle: {
                                color: '#AAAAAA'
                            }
                        }
                    },
                    yAxis: {
                        type: 'category',
                        splitLine: {
                            show: true
                        },
                        axisLabel: {
                            /* formatter:'{value} %',*/
                            textStyle: {
                                color: '#AAAAAA'
                            }
                        },
                        data: [
                            (100 - 0) / 5,
                            (100 - 0) / 5 * 2,
                            (100 - 0) / 5 * 3,
                            (100 - 0) / 5 * 4,
                            (100 - 0) / 5 * 5,
                        ]
                    },
                    series: [
                        {
                            name: '内存中排序占的比率区间分部',
                            type: 'bar',
                            barWidth: 30,
                            data: xdata
                        }
                    ]

                };
                database_nczpx_mzl_qjfb.setOption(option);
            }
        }, error: function (textStatus) {
            console.log("error:" + textStatus.status);
        }
    });
}

//表空间使用率
//PM-00-03-004-01
function queryDataBaseBkjSyl() {
    $.ajax({
        url: ctx + "/load/queryTableSpace",
        type: "post",
        data: "EXT_UNIT_ID=" + EXT_UNIT_ID + "&KPI_CODE=" + "KPI-oracle-all-34" + "&DATE_TYPE=" + DATE_TYPE + "&CLASS_NAME=" + CLASS_NAME,
        success: function (data) {
            var map = JSON.parse(data);
            var list = map.list;
            var xdata = [];
            var ydata = [];
            var x_value = [];
            for (var i = 0; i < list.length; i++) {
                var a = list[i].AVG_VALUE;
                var b = list[i].UNIT_ID;
            }
            if (a == undefined || b == undefined) {
                var table = "<h3 style='margin-top: 200px;padding-left: 340px;'>" + "暂无数据" + "</h3>";
                $("#database_tableSpace").html(table);
            } else {
                if (DATE_TYPE == "showYear") {
                    for (var i = 0; i < list.length; i++) {
                        // x_value = list[i].DATA_TIME.split("-");
                        // xdata.push(x_value[2]);
                        // x_value = list[i].DATA_TIME;
                        // xdata.push(x_value);
                        x_value = list[i].UNIT_ID.split(":");
                        xdata.push(x_value[3]);
                        ydata.push(list[i].AVG_VALUE);
                    }
                } else if (DATE_TYPE == "showMonth") {
                    for (var i = 0; i < list.length; i++) {
                        // x_value = list[i].DATA_TIME.split("-");
                        // xdata.push(x_value[2]);
                        // x_value = list[i].DATA_TIME;
                        // xdata.push(x_value);
                        x_value = list[i].UNIT_ID.split(":");
                        xdata.push(x_value[3]);
                        ydata.push(list[i].AVG_VALUE);
                    }
                } else if (DATE_TYPE == "showWeek") {
                    for (var i = 0; i < list.length; i++) {
                        // x_value = list[i].DATA_TIME.split("-");
                        // xdata.push(x_value[2]);
                        // x_value = list[i].DATA_TIME;
                        // xdata.push(x_value);
                        x_value = list[i].UNIT_ID.split(":");
                        xdata.push(x_value[3]);
                        ydata.push(list[i].AVG_VALUE);
                    }
                } else {
                    for (var i = 0; i < list.length; i++) {
                        // x_value = list[i].UNIT_ID.split("-");
                        // xdata.push(x_value[3]);
                        // alert(xdata);
                        x_value = list[i].UNIT_ID.split(":");
                        xdata.push(x_value[3]);
                        ydata.push(list[i].AVG_VALUE);
                    }
                }
                option = {
                    color: ['#23CBFE'],
                    title: {
                        text: '',
                        subtext: ''
                    },
                    tooltip: {
                        trigger: 'axis',
                        axisPointer: {
                            type: 'shadow'
                        }
                    },
                    legend: {
                        data: ['表空间使用率'],
                        textStyle: {
                            color: '#AAAAAA'
                        }
                    },
                    grid: {
                        left: '3%',
                        right: '4%',
                        bottom: '3%',
                        containLabel: true
                    },
                    xAxis: [
                        {
                            type: 'category',
                            data: xdata,
                            axisTick: {
                                alignWithLabel: true
                            }
                        }
                    ],
                    yAxis: [
                        {
                            type: 'value',
                            max: 100,
                            splitLine: {
                                show: true,
                            },
                            name: '',
                            nameTextStyle: {
                                color: '#000000',
                            },
                            axisLabel: {
                                formatter: '{value} %',
                                textStyle: {
                                    color: '#000000'
                                }
                            }
                        },
                    ],
                    series: [
                        {
                            name: '表空间使用率',
                            type: 'bar',
                            barWidth: '60%',
                            data: ydata
                        }
                    ]
                };
                database_tableSpace.setOption(option);
            }
        }, error: function (textStatus) {
            console.log("error:" + textStatus.status);
        }
    });
}


// //回滚段指标信息
// //PM-00-03-007-01 利用情况       PM-00-03-007-02  竞争情况
// function queryGdm(DATE_TYPE) {
//     var str = gdList.toString();
//     $.ajax({
//         url: ctx + "/load/queryTable",
//         type: "post",
//         data: "EXT_UNIT_ID=" + EXT_UNIT_ID + "&RESU=" + str + "&DATE_TYPE=" + DATE_TYPE,
//         success: function (data) {
//             var map = JSON.parse(data);
//             var list1 = map["PM-00-03-007-01"];
//             var list2 = map["PM-00-03-007-02"];
//             var table = "";
//             if (list1 != null && list1.length != 0) {
//                 table += "<tr>" +
//                     "<th><span >" + "回滚段名" + "</span></th>" +
//                     "<th><span >" + list1[0].KPI_NAME + "</span></th>" +
//                     "</tr>";
//             }
//             if (list2 != null && list2.length != 0) {
//                 table += "<tr>" +
//                     "<th><span >" + "回滚段名" + "</span></th>" +
//                     "<th><span >" + list2[0].KPI_NAME + "</span></th>" +
//                     "</tr>";
//             }
//             if (DATE_TYPE == "showYear") {
//                 var UnitIdList = new Array()   //结果ID列表
//                 var succList2 = new Array();
//                 var countList2 = new Array();
//                 var AvgList2 = new Array(); //结果VALUE列表
//                 var AvgList3 = new Array();
//
//                 var map = new Map();            //结果map
//                 var iSameLine = 0 //相同条数标志位
//                 var SumValue2 = 0 //和值
//                 var SumValue3 = 0
//
//                 var gsuccValue = 0
//                 var gcountValue = 0
//                 var sTreeUnitId   //上一次ID
//
//                 var str           //原始unit_id
//                 var sUnitId       //名称
//                 var succValue
//                 var countValue
//                 var AvgValue2
//                 var AvgValue3
//
//                 for (i = 1; i < list1.length; i++) {
//                     str = list1[i].UNIT_ID;
//                     sUnitId = str.split("-")[4];
//                     succValue = parseInt(list1[i].SUCCESS_VALUE);
//                     countValue = parseInt(list1[i].COUNT_VALUE);
//                     AvgValue2 = parseInt(list2[i].AVG_VALUE)  //获取对应的avg_value/
//
//                     if (i == 0) {                    //第一次进入标志位强制相同
//                         sTreeUnitId = sUnitId;
//                     }
//                     if (sTreeUnitId == sUnitId) {   //本次循环获取id与上次相同累加并继续下次循环
//                         gsuccValue = gsuccValue + succValue;
//                         gcountValue = gcountValue + countValue;
//                         SumValue2 = SumValue2 + AvgValue2;
//                         SumValue3 = SumValue3 + AvgValue3;
//
//                         iSameLine = iSameLine + 1     //桩相同条数
//                         // console.log(i + 1)
//                         if (i == list1.length - 1) {   //循环到最后一次如果与上一次相同直接写出结果
//                             UnitIdList.push(sTreeUnitId);
//                             succList2.push(gsuccValue);
//                             countList2.push(gcountValue);
//                             AvgList2.push(SumValue2);
//                             AvgList3.push(SumValue3);
//                             map.set(sTreeUnitId, SumValue2)
//                         }
//                     } else {
//                         UnitIdList.push(sTreeUnitId);
//                         succList2.push(gsuccValue);
//                         countList2.push(gcountValue);
//                         AvgList2.push(SumValue2);
//                         AvgList3.push(SumValue3);
//
//                         map.set(sTreeUnitId, SumValue2);
//
//                         iSameLine = 1
//                         sTreeUnitId = sUnitId
//                         gsuccValue = succValue;
//                         gcountValue = countValue;
//                         SumValue2 = AvgValue2
//                         SumValue3 = AvgValue3;
//
//                     }
//                 }
//                 if (UnitIdList !=null && UnitIdList.length != 0) {
//                     for (var c = 1; c < UnitIdList.length; c++) {
//                         table += "<tr>" +
//                             "<td><span >" + UnitIdList[c] + "</span></td>" +
//                             "<td><span >" + succList2[c] / countList2[c] * 100 + "%" + "</span></td>" +
//                             "<td><span >" + AvgList2[c] + "</span></td>" +
//                             "</tr>";
//                     }
//                     $("#row6").css("height", UnitIdList.length * 34 + 14 + 34 + 34);
//                 }
//             } else {
//                 if (list1 != null && list1.length != 0) {
//                     for (var i = 1; i < list1.length; i++) {
//                         var str = list1[i].UNIT_ID;
//                         var PORTNAME = str.split("-")[4];
//                         table += "<tr>" +
//                             "<td><span >" + PORTNAME + "</span></td>" +
//                             "<td><span >" + parseInt((list1[i].SUCCESS_VALUE / list1[i].COUNT_VALUE) * 100) + "%" + "</span></td>" +
//                             "</tr>";
//                     }
//                     $("#row6").css("height", list1.length * 34 + 14 + 34 + 34);
//                 }
//                 if (list2 != null && list2.length != 0) {
//                     for (var i = 1; i < list2.length; i++) {
//                         var str = list2[i].UNIT_ID;
//                         var PORTNAME = str.split("-")[4];
//                         table += "<tr>" +
//                             "<td><span >" + PORTNAME + "</span></td>" +
//                             "<td><span >" + list2[i].AVG_VALUE + "</span></td>" +
//                             "</tr>";
//                     }
//                     $("#row6").css("height", list1.length * 34 + 14 + 34 + 34);
//                 }
//             }
//             $("#gdm").append(table);
//         }, error: function (textStatus) {
//             console.log("error:" + textStatus.status);
//         }
//     });
// }


//UNDO表空间
//FM-00-03-001-02 表空间状态      PM-00-03-009-11 UNDO表空间情况
function queryUndotable() {
    var str = undoList.toString();
    $.ajax({
        url: ctx + "/load/queryTable",
        type: "post",
        data: "EXT_UNIT_ID=" + EXT_UNIT_ID + "&RESU=" + str + "&DATE_TYPE=" + DATE_TYPE + "&CLASS_NAME=" + CLASS_NAME,
        success: function (data) {
            var map = JSON.parse(data);
            var list1 = map["FM-00-03-001-02"];
            var list2 = map["PM-00-03-009-11"];
            var table = "";
            if (list1.length == 1 && list2.length != 1) {
                table +=
                    "<tr><th><span >" + "UNDO表空间名称" + "</span></th>" +
                    "<th><span >" + list2[0].KPI_NAME + "</span></th></tr>" +
                    "<tr><td><span >" + "暂无数据" + "</span></td></tr>";
            } else {
                table +=
                    "<tr><th><span >" + "UNDO表空间名称" + "</span></th>" +
                    "<th><span >" + list2[0].KPI_NAME + "</span></th></tr>";
                if (DATE_TYPE == "showYear") {
                    var UnitIdList = new Array()   //结果ID列表
                    var succList2 = new Array();
                    var countList2 = new Array();
                    var AvgList2 = new Array(); //结果VALUE列表
                    var AvgList3 = new Array();

                    var map = new Map();            //结果map
                    var iSameLine = 0 //相同条数标志位
                    var SumValue2 = 0 //和值
                    var SumValue3 = 0

                    var gsuccValue = 0
                    var gcountValue = 0
                    var sTreeUnitId   //上一次ID

                    var str           //原始unit_id
                    var sUnitId       //名称
                    var succValue
                    var countValue
                    var AvgValue2
                    var AvgValue3

                    for (i = 1; i < list1.length; i++) {
                        str = list1[i].UNIT_ID;
                        sUnitId = str.split("-")[4];
                        succValue = parseInt(list1[i].SUCCESS_VALUE);
                        countValue = parseInt(list1[i].COUNT_VALUE);
                        AvgValue2 = parseInt(list2[i].AVG_VALUE)  //获取对应的avg_value/

                        if (i == 0) {                    //第一次进入标志位强制相同
                            sTreeUnitId = sUnitId;
                        }
                        if (sTreeUnitId == sUnitId) {   //本次循环获取id与上次相同累加并继续下次循环
                            gsuccValue = gsuccValue + succValue;
                            gcountValue = gcountValue + countValue;
                            SumValue2 = SumValue2 + AvgValue2;
                            SumValue3 = SumValue3 + AvgValue3;

                            iSameLine = iSameLine + 1     //桩相同条数
                            // console.log(i + 1)
                            if (i == list1.length - 1) {   //循环到最后一次如果与上一次相同直接写出结果
                                UnitIdList.push(sTreeUnitId);
                                succList2.push(gsuccValue);
                                countList2.push(gcountValue);
                                AvgList2.push(SumValue2);
                                AvgList3.push(SumValue3);
                                map.set(sTreeUnitId, SumValue2)
                            }
                        } else {
                            UnitIdList.push(sTreeUnitId);
                            succList2.push(gsuccValue);
                            countList2.push(gcountValue);
                            AvgList2.push(SumValue2);
                            AvgList3.push(SumValue3);

                            map.set(sTreeUnitId, SumValue2);
                            iSameLine = 1
                            sTreeUnitId = sUnitId
                            gsuccValue = succValue;
                            gcountValue = countValue;
                            SumValue2 = AvgValue2
                            SumValue3 = AvgValue3;

                        }
                    }

                    for (var c = 1; c < UnitIdList.length; c++) {
                        table += "<tr>" +
                            "<td><span >" + UnitIdList[c] + "</span></td>" +
                            "<td><span >" + succList2[c] / countList2[c] * 100 + "%" + "</span></td>" +
                            "<td><span >" + AvgList2[c] + "</span></td>" +
                            "</tr>";
                    }
                    $("#row7").css("height", UnitIdList.length * 34 + 14 + 34 + 34);
                } else {
                    if (list1 != null && list1.length != 0) {
                        for (var i = 1; i < list1.length; i++) {
                            var str = list1[i].UNIT_ID;
                            var PORTNAME = str.split("-")[4];
                            table += "<tr>" +
                                "<td><span >" + PORTNAME + "</span></td>" +
                                "<td><span >" + parseInt((list1[i].SUCCESS_VALUE / list1[i].COUNT_VALUE) * 100) + "%" + "</span></td>" +
                                "</tr>";
                        }
                        $("#row7").css("height", list1.length * 34 + 14 + 34 + 34);
                    }
                    if (list2 != null && list2.length != 0) {
                        for (var i = 1; i < list2.length; i++) {
                            var str = list2[i].UNIT_ID;
                            var PORTNAME = str.split("-")[4];
                            table += "<tr>" +
                                "<td><span >" + PORTNAME + "</span></td>" +
                                "<td><span >" + list2[i].AVG_VALUE + "</span></td>" +
                                "</tr>";
                        }
                        $("#row7").css("height", list1.length * 34 + 14 + 34 + 34);
                    }
                }
            }
            $("#Undotable").append(table);
        }, error: function (textStatus) {
            console.log("error:" + textStatus.status);
        }
    });
}

// //按钮事件
// $(".rad_1").click(function () {
//     var id = $(this).attr('for');
//     // alert(id);
//     database_state.clear();//数据库状态
//     database_jdbc.clear();//JDBC可链接性
//     database_zdlj_zyl.clear();//最大连接占用率
//     database_zdlj_slgl.clear();//最大连接数量概览
//     database_gxnc_bfb.clear();//共享内存使用百分比
//     database_gxnc_slgl.clear();//共享内存使用数量概览
//     database_read.clear();//共享内存的读命中率
//     database_read_gl.clear();//共享内存的读命中率概览
//     database_tableSpace.clear();//表空间使用率("===================================")
//
//     $("#database_info tr").remove();
//     // $("#database_info1 tr").remove();
//     // $("#gdm tr").remove();//表格id+tr
//     $("#Undotable tr").remove();//表格id+tr
//
//     DataBaseInformationViewController(id);
//     queryDataBaseState(id);
//     queryDataBaseJdbc(id);
//     queryDataBaseZdLj(id);
//     queryDataBaseZdLjDzt(id);
//     queryDataBaseGxncZxt(id);
//     queryDataBaseGxncDzt(id);
//     queryDataBaseReadZxt(id);
//     queryDataBaseReadDzt(id);
//     queryDataBaseBkjSyl(id);
//     // queryGdm(id);
//     /*queryUndotable(id);*/
// });

